Files
rogaining_srv/docker-compose-prod.yaml

85 lines
2.3 KiB
YAML
Raw Permalink Normal View History

2023-05-25 22:41:41 +05:30
services:
postgres-db:
image: kartoza/postgis:12.0
ports:
- 5432:5432
volumes:
- postgres_data:/var/lib/postgresql
- ./custom-postgresql.conf:/etc/postgresql/12/main/postgresql.conf
2025-09-03 04:04:34 +09:00
- ./custom-pg_hba.conf:/etc/postgresql/12/main/pg_hba.conf
2025-08-20 19:15:19 +09:00
- ./rogaining.sql:/sql/rogaining.sql
2025-08-25 14:28:30 +09:00
- ./sqls:/sqls
- ./create_location2025_table.sql:/sql/create_location2025_table.sql
2023-05-25 22:41:41 +05:30
environment:
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PASS=${POSTGRES_PASS}
- POSTGRES_DBNAME=${POSTGRES_DBNAME}
- POSTGRES_MAX_CONNECTIONS=600
2025-08-25 14:28:30 +09:00
deploy:
resources:
limits:
memory: 2G
reservations:
memory: 1G
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DBNAME}"]
interval: 30s
timeout: 10s
retries: 5
start_period: 30s
2023-05-25 22:41:41 +05:30
restart: "on-failure"
networks:
- rog-api
app:
build:
context: .
dockerfile: Dockerfile.gdal
2025-08-25 14:28:30 +09:00
command: bash -c "./wait-for-postgres.sh postgres-db && gunicorn config.wsgi:application --bind 0.0.0.0:8000"
2023-05-25 22:41:41 +05:30
volumes:
- .:/app
- static_volume:/app/static
2023-07-15 10:46:32 +05:30
- media_volume:/app/media
2023-05-25 22:41:41 +05:30
env_file:
- .env
2025-08-30 02:25:01 +09:00
environment:
- MPLBACKEND=Agg
- MATPLOTLIB_BACKEND=Agg
- PYTHONWARNINGS=ignore
- GDAL_DISABLE_READDIR_ON_OPEN=YES
2025-08-25 14:28:30 +09:00
healthcheck:
test: ["CMD-SHELL", "python -c \"import urllib.request; urllib.request.urlopen('http://localhost:8000')\" || exit 1"]
interval: 30s
timeout: 10s
retries: 3
start_period: 60s
2023-05-25 22:41:41 +05:30
restart: "on-failure"
depends_on:
2025-08-25 14:28:30 +09:00
postgres-db:
condition: service_healthy
2023-05-25 22:41:41 +05:30
networks:
- rog-api
nginx:
image: nginx:1.19
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf
- static_volume:/app/static
2023-07-15 10:46:32 +05:30
- media_volume:/app/media
- ./supervisor/html:/usr/share/nginx/html
2023-05-25 22:41:41 +05:30
ports:
- 8100:80
depends_on:
- app
networks:
- rog-api
networks:
rog-api:
driver: bridge
volumes:
postgres_data:
static_volume:
2023-07-15 10:46:32 +05:30
media_volume: