55 lines
1.2 KiB
YAML
55 lines
1.2 KiB
YAML
name: horilla
|
|
|
|
services:
|
|
web:
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile
|
|
restart: unless-stopped
|
|
environment:
|
|
DATABASE_URL: postgres://postgres:postgres@db:5432/horilla
|
|
CREATE_SUPERUSER: "true"
|
|
command: sh ./entrypoint.sh
|
|
depends_on:
|
|
db:
|
|
condition: service_healthy
|
|
volumes:
|
|
- media:/app/media
|
|
- staticfiles:/app/staticfiles
|
|
|
|
db:
|
|
image: postgres:16
|
|
environment:
|
|
POSTGRES_DB: horilla
|
|
POSTGRES_USER: postgres
|
|
POSTGRES_PASSWORD: postgres
|
|
POSTGRES_INITDB_ARGS: "--auth-host=scram-sha-256"
|
|
PGDATA: /var/lib/postgresql/data/pgdata
|
|
# Expose DB only within the compose network (no host port)
|
|
restart: unless-stopped
|
|
volumes:
|
|
- horilla-data:/var/lib/postgresql/data
|
|
healthcheck:
|
|
test: ["CMD", "pg_isready", "-U", "postgres"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
|
|
nginx:
|
|
image: nginx:1.27-alpine
|
|
restart: unless-stopped
|
|
depends_on:
|
|
web:
|
|
condition: service_started
|
|
ports:
|
|
- "80:80"
|
|
volumes:
|
|
- ./deploy/nginx/nginx.conf:/etc/nginx/nginx.conf:ro
|
|
- staticfiles:/staticfiles:ro
|
|
- media:/media:ro
|
|
|
|
volumes:
|
|
horilla-data:
|
|
media:
|
|
staticfiles:
|