60 lines
1.4 KiB
YAML
60 lines
1.4 KiB
YAML
services:
|
|
postgres:
|
|
image: postgres:17-alpine
|
|
restart: unless-stopped
|
|
shm_size: 128mb
|
|
env_file:
|
|
- ${DATABASE_ENV_FILE:-../.env.staging.database}
|
|
command:
|
|
- postgres
|
|
- -c
|
|
- max_connections=30
|
|
- -c
|
|
- shared_buffers=256MB
|
|
- -c
|
|
- effective_cache_size=1GB
|
|
- -c
|
|
- work_mem=4MB
|
|
volumes:
|
|
- postgres_data:/var/lib/postgresql/data
|
|
- ./postgres/001-bootstrap-roles.sh:/docker-entrypoint-initdb.d/001-bootstrap-roles.sh:ro
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U \"$${POSTGRES_USER}\" -d \"$${POSTGRES_DB}\""]
|
|
interval: 5s
|
|
timeout: 5s
|
|
retries: 20
|
|
start_period: 10s
|
|
networks: [app]
|
|
|
|
migrator:
|
|
image: ${WEB_IMAGE:-jyotisha-web:local}
|
|
profiles: ["migration"]
|
|
restart: "no"
|
|
env_file:
|
|
- ${DATABASE_ENV_FILE:-../.env.staging.database}
|
|
working_dir: /app/frontend
|
|
command: ["npm", "run", "db:migrate"]
|
|
depends_on:
|
|
postgres:
|
|
condition: service_healthy
|
|
networks: [app]
|
|
|
|
migration-checker:
|
|
image: ${WEB_IMAGE:-jyotisha-web:local}
|
|
profiles: ["migration-check"]
|
|
restart: "no"
|
|
env_file:
|
|
- ${DATABASE_ENV_FILE:-../.env.staging.database}
|
|
working_dir: /app/frontend
|
|
command: ["npm", "run", "db:migrate:check"]
|
|
depends_on:
|
|
postgres:
|
|
condition: service_healthy
|
|
networks: [app]
|
|
|
|
volumes:
|
|
postgres_data:
|
|
|
|
networks:
|
|
app:
|