Files
Diarios-Oficiais-ALEMS/docker-compose.production.yml

86 lines
2.4 KiB
YAML
Raw Normal View History

2025-06-16 13:11:57 -04:00
version: '3.8'
2025-03-06 12:10:17 -03:00
volumes:
production_postgres_data: {}
production_postgres_data_backups: {}
2025-06-16 13:11:57 -04:00
production_esdata: {}
production_django_static: {}
2025-03-06 12:10:17 -03:00
production_django_media: {}
services:
django:
build:
context: .
dockerfile: ./compose/production/django/Dockerfile
image: diarios_oficiais_alems_production_django
2025-06-16 13:11:57 -04:00
container_name: diarios_oficiais_alems_production_django
restart: unless-stopped
2025-03-06 12:10:17 -03:00
depends_on:
- postgres
2025-06-16 13:11:57 -04:00
- elasticsearch
volumes:
- production_django_media:/app/diarios_oficiais_alems/media
- production_django_static:/app/diarios_oficiais_alems/static
2025-03-06 12:10:17 -03:00
env_file:
- ./.envs/.production/.django
- ./.envs/.production/.postgres
2025-06-16 13:11:57 -04:00
ports:
- '8005:8005'
2025-03-06 12:10:17 -03:00
command: /start
postgres:
build:
context: .
dockerfile: ./compose/production/postgres/Dockerfile
image: diarios_oficiais_alems_production_postgres
2025-06-16 13:11:57 -04:00
container_name: diarios_oficiais_alems_production_postgres
restart: unless-stopped
2025-03-06 12:10:17 -03:00
volumes:
- production_postgres_data:/var/lib/postgresql/data
- production_postgres_data_backups:/backups
env_file:
- ./.envs/.production/.postgres
2025-06-16 13:11:57 -04:00
healthcheck:
test: ["CMD-SHELL", "pg_isready -U debug"]
interval: 10s
timeout: 5s
retries: 5
2025-03-06 12:10:17 -03:00
2025-06-16 13:11:57 -04:00
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:8.17.3
container_name: diarios_oficiais_alems_production_elasticsearch
restart: unless-stopped
environment:
- discovery.type=single-node
- xpack.security.enabled=true
- "ES_JAVA_OPTS=-Xms2g -Xmx2g"
- bootstrap.memory_lock=true
2025-03-06 12:10:17 -03:00
volumes:
2025-06-16 13:11:57 -04:00
- production_esdata:/usr/share/elasticsearch/data
ulimits:
memlock:
soft: -1
hard: -1
healthcheck:
test: ["CMD-SHELL", "curl -f http://localhost:9200/_cluster/health || exit 1"]
2025-03-06 12:10:17 -03:00
2025-06-16 13:11:57 -04:00
frontend:
image: nginx:alpine
container_name: diarios_oficiais_alems_production_frontend
restart: unless-stopped
2025-03-06 12:10:17 -03:00
depends_on:
- django
volumes:
2025-06-16 13:11:57 -04:00
- production_django_static:/usr/share/nginx/static:ro
2025-03-06 12:10:17 -03:00
- production_django_media:/usr/share/nginx/media:ro
2025-06-16 13:11:57 -04:00
- ./compose/production/nginx/nginx.conf:/etc/nginx/nginx.conf:ro
ports:
- "80:80"
- "443:443"
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost"]
interval: 30s
timeout: 10s
retries: 3