ixg_platform/docker-compose.yml
ixgadmin 8f1649aaa1 Deployment hardening: HTTPS/CSRF settings, loopback-only app port, entrypoint passthrough
- settings: trust nginx X-Forwarded-Proto, mark session and CSRF cookies secure,
  and set the CSRF trusted origins for the ixgltd.com hosts
- docker-compose: bind the app port to 127.0.0.1 only; nginx fronts it, so there
  is no reason for 0.0.0.0
- entrypoint: when the container is given a command, run that instead of always
  starting gunicorn (needed for manage.py shell and the test suite)
- gitignore: keep Celery runtime state and stray local backups out of the tree

No functional change to the application itself.
2026-09-16 16:39:07 +00:00

102 lines
2.2 KiB
YAML

services:
ixg-postgres:
image: postgres:15-alpine
container_name: ixg-platform-db
restart: unless-stopped
networks:
- client-infra
volumes:
- postgres_data:/var/lib/postgresql/data
environment:
POSTGRES_DB: ixg_platform
POSTGRES_USER: postgres
POSTGRES_PASSWORD: GYV9G8IuEbcTr39k2NxGbcLpYilD1mvhSmkPFuCs2fM=
ports:
- "127.0.0.1:5433:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 5s
timeout: 5s
retries: 5
ixg-redis:
image: redis:7-alpine
container_name: ixg-platform-redis
restart: unless-stopped
networks:
- client-infra
ports:
- "127.0.0.1:6379:6379"
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 5s
retries: 5
app:
build: .
container_name: ixg-platform-app
restart: unless-stopped
networks:
- client-infra
depends_on:
ixg-postgres:
condition: service_healthy
ixg-redis:
condition: service_healthy
volumes:
- .:/app
- ./staticfiles:/app/staticfiles
- ./media:/app/media
- ./documents:/data/ixg-documents
env_file:
- ./config/secrets/env.production
environment:
DB_HOST: ixg-postgres
DB_PORT: 5432
ports:
- "127.0.0.1:8000:8000"
celery_worker:
build: .
container_name: ixg-platform-celery-worker
restart: unless-stopped
networks:
- client-infra
depends_on:
- ixg-postgres
- ixg-redis
volumes:
- .:/app
- ./documents:/data/ixg-documents
env_file:
- ./config/secrets/env.production
environment:
DB_HOST: ixg-postgres
DB_PORT: 5432
command: celery -A dsp_platform worker -l info
celery_beat:
build: .
container_name: ixg-platform-celery-beat
restart: unless-stopped
networks:
- client-infra
depends_on:
- ixg-postgres
- ixg-redis
volumes:
- .:/app
env_file:
- ./config/secrets/env.production
environment:
DB_HOST: ixg-postgres
DB_PORT: 5432
command: celery -A dsp_platform beat -l info
volumes:
postgres_data:
networks:
client-infra:
external: true