This commit is contained in:
2026-03-19 16:07:35 +07:00
commit 39b0358b08
63 changed files with 3128 additions and 0 deletions

62
docker-compose.yml Normal file
View File

@@ -0,0 +1,62 @@
services:
postgres:
image: postgres:16
container_name: pg-control-postgres
restart: unless-stopped
environment:
POSTGRES_DB: app_admin
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
PGDATA: /var/lib/postgresql/data/pgdata
ports:
- "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
- ./infra/postgres/init.sql:/docker-entrypoint-initdb.d/001-init.sql:ro
- ./infra/postgres/postgresql.conf:/etc/postgresql/postgresql.conf:ro
- ./infra/postgres/pg_hba.conf:/etc/postgresql/pg_hba.conf:ro
- postgres_logs:/var/log/postgresql
command: [
"postgres",
"-c",
"config_file=/etc/postgresql/postgresql.conf",
"-c",
"hba_file=/etc/postgresql/pg_hba.conf"
]
backend:
build:
context: ./backend
dockerfile: Dockerfile
container_name: pg-control-backend
restart: unless-stopped
depends_on:
- postgres
env_file:
- ./backend/.env.example
environment:
NODE_ENV: production
PORT: 4000
DATABASE_URL: postgresql://postgres:postgres@postgres:5432/app_admin
SESSION_SECRET: super-secret-change-me
POSTGRES_CONTAINER_NAME: pg-control-postgres
ALLOWED_ORIGIN: http://localhost:5173
ports:
- "4000:4000"
frontend:
build:
context: ./frontend
dockerfile: Dockerfile
container_name: pg-control-frontend
restart: unless-stopped
depends_on:
- backend
environment:
VITE_API_BASE_URL: http://localhost:4000/api
ports:
- "5173:80"
volumes:
postgres_data:
postgres_logs: