63 lines
1.6 KiB
YAML
63 lines
1.6 KiB
YAML
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:
|
|
- .env
|
|
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
|
|
args:
|
|
VITE_API_BASE_URL: /api
|
|
container_name: pg-control-frontend
|
|
restart: unless-stopped
|
|
depends_on:
|
|
- backend
|
|
ports:
|
|
- "5173:80"
|
|
|
|
volumes:
|
|
postgres_data:
|
|
postgres_logs:
|