2024-11-23 01:09:57 +01:00
|
|
|
x-op-restart-policy: &restart_policy
|
|
|
|
restart: unless-stopped
|
|
|
|
|
2024-11-17 16:37:23 +01:00
|
|
|
services:
|
|
|
|
shimatta-kenkyusho-web:
|
2024-11-23 01:09:57 +01:00
|
|
|
<<: *restart_policy
|
2024-11-17 16:37:23 +01:00
|
|
|
build: .
|
2024-11-25 23:38:37 +01:00
|
|
|
user: "${DJANGO_USER_ID:-0}:${DJANGO_USER_GID:-0}"
|
2024-11-17 16:37:23 +01:00
|
|
|
volumes:
|
|
|
|
- "${DJANGO_STATIC_VOL:-./run/static}:/var/static"
|
|
|
|
- "${DJANGO_MEDIA_VOL:-./run/media}:/var/media"
|
|
|
|
environment:
|
|
|
|
DJANGO_POSTGRESQL_PW: "${DJANGO_POSTGRESQL_PW:-p4ssw0rd}"
|
|
|
|
DJANGO_POSTGRESQL_USER: "postgres"
|
|
|
|
DJANGO_SECRET_KEY: "${DJANGO_SECRET_KEY}"
|
|
|
|
DJANGO_ALLOWED_HOST: "${DJANGO_ALLOWED_HOST}"
|
|
|
|
DJANGO_STATIC_ROOT: "/var/static"
|
|
|
|
DJANGO_MEDIA_URL: "${DJANGO_MEDIA_URL}"
|
|
|
|
DJANGO_MEDIA_ROOT: "/var/media"
|
|
|
|
DJANGO_POSTGRESQL_SOCKET: "shimatta-kenkyusho-db"
|
|
|
|
DJANGO_POSTGRESQL_PORT: "5432"
|
|
|
|
DJANGO_FORCE_DEV_MODE: ${DJANGO_FORCE_DEV_MODE:-False}
|
|
|
|
ports:
|
|
|
|
- "${PORT}:8000"
|
|
|
|
networks:
|
|
|
|
- backendnet
|
|
|
|
depends_on:
|
2024-11-17 16:50:10 +01:00
|
|
|
shimatta-kenkyusho-db:
|
|
|
|
condition: service_healthy
|
2024-11-17 19:10:28 +01:00
|
|
|
healthcheck:
|
|
|
|
test: ["CMD-SHELL", "curl -f localhost:8000/healthcheck"]
|
|
|
|
interval: 5s
|
|
|
|
timeout: 5s
|
|
|
|
retries: 5
|
|
|
|
start_period: 30s
|
2024-11-17 16:37:23 +01:00
|
|
|
|
|
|
|
shimatta-kenkyusho-db:
|
2024-11-23 01:09:57 +01:00
|
|
|
<<: *restart_policy
|
2024-11-17 16:37:23 +01:00
|
|
|
image: postgres:16.5-alpine
|
|
|
|
environment:
|
|
|
|
POSTGRES_PASSWORD: "${DJANGO_POSTGRESQL_PW:-p4ssw0rd}"
|
|
|
|
POSTGRES_DB: "shimatta_kenkyusho"
|
|
|
|
volumes:
|
2024-11-17 19:36:27 +01:00
|
|
|
- "${PGDATA_VOL:-./run/pgdata}:/var/lib/postgresql/data"
|
2024-11-17 16:37:23 +01:00
|
|
|
networks:
|
|
|
|
- backendnet
|
2024-11-17 16:50:10 +01:00
|
|
|
healthcheck:
|
|
|
|
test: ["CMD-SHELL", "pg_isready -U postgres"]
|
|
|
|
interval: 5s
|
|
|
|
timeout: 5s
|
|
|
|
retries: 5
|
2024-11-17 16:37:23 +01:00
|
|
|
|
|
|
|
networks:
|
|
|
|
backendnet:
|