2024-11-17 16:37:23 +01:00
|
|
|
services:
|
|
|
|
shimatta-kenkyusho-web:
|
|
|
|
build: .
|
|
|
|
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:
|
|
|
|
image: postgres:16.5-alpine
|
|
|
|
environment:
|
|
|
|
POSTGRES_PASSWORD: "${DJANGO_POSTGRESQL_PW:-p4ssw0rd}"
|
|
|
|
POSTGRES_DB: "shimatta_kenkyusho"
|
|
|
|
volumes:
|
|
|
|
- "${PGDATA:-./run/pgdata}:/var/lib/postgresql/data"
|
|
|
|
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:
|