119 lines
3.1 KiB
YAML
119 lines
3.1 KiB
YAML
name: who_need_help
|
|
|
|
x-app-environment: &app-environment
|
|
APP_ROLE: web
|
|
DATABASE_URL: ecto://postgres:postgres@db/who_need_help
|
|
SECRET_KEY_BASE: ${SECRET_KEY_BASE:-h0rJQH8xgH9vV1cS7gVw6M2oI0Kp3Lx9uA5fE4bD8nR7qT2yW6zC1sP9mN3kF5jH}
|
|
HANDOVER_SECRET: ${HANDOVER_SECRET:-local-compose-handover-secret-change-before-public-use}
|
|
RELEASE_COOKIE: ${RELEASE_COOKIE:-local-compose-beam-cookie-change-before-public-use}
|
|
DNS_CLUSTER_QUERY: web
|
|
PHX_HOST: ${PHX_HOST:-localhost}
|
|
PHX_SCHEME: http
|
|
PHX_URL_PORT: ${HTTP_PORT:-4010}
|
|
PORT: "4000"
|
|
POOL_SIZE: ${POOL_SIZE:-10}
|
|
SMTP_RELAY: mailpit
|
|
SMTP_PORT: "1025"
|
|
CODEX_SESSION_ID: ${CODEX_SESSION_ID:-not-configured}
|
|
RATE_LIMIT_POLICIES_JSON: ${RATE_LIMIT_POLICIES_JSON:-{}}
|
|
MAP_TILE_URL: ${MAP_TILE_URL:-https://tile.openstreetmap.org/{z}/{x}/{y}.png}
|
|
|
|
services:
|
|
proxy:
|
|
image: traefik:v3.7
|
|
command:
|
|
- --api.dashboard=false
|
|
- --providers.docker=true
|
|
- --providers.docker.exposedbydefault=false
|
|
- --entrypoints.web.address=:80
|
|
ports:
|
|
- "${HTTP_PORT:-4010}:80"
|
|
volumes:
|
|
- /var/run/docker.sock:/var/run/docker.sock:ro
|
|
networks: [edge, internal]
|
|
restart: unless-stopped
|
|
|
|
db:
|
|
image: postgis/postgis:18-3.6-alpine
|
|
environment:
|
|
POSTGRES_DB: who_need_help
|
|
POSTGRES_USER: postgres
|
|
POSTGRES_PASSWORD: postgres
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U postgres -d who_need_help"]
|
|
interval: 3s
|
|
timeout: 3s
|
|
retries: 20
|
|
volumes:
|
|
- postgres_data:/var/lib/postgresql
|
|
networks: [internal]
|
|
restart: unless-stopped
|
|
|
|
mailpit:
|
|
image: axllent/mailpit:v1.27
|
|
ports:
|
|
- "${MAILPIT_PORT:-8027}:8025"
|
|
networks: [edge, internal]
|
|
restart: unless-stopped
|
|
|
|
migrate:
|
|
image: who-need-help:local
|
|
build:
|
|
context: .
|
|
environment:
|
|
<<: *app-environment
|
|
APP_ROLE: migrate
|
|
command: ["/app/bin/migrate"]
|
|
depends_on:
|
|
db:
|
|
condition: service_healthy
|
|
networks: [internal]
|
|
restart: "no"
|
|
|
|
web:
|
|
image: who-need-help:local
|
|
environment:
|
|
<<: *app-environment
|
|
APP_ROLE: web
|
|
PHX_SERVER: "true"
|
|
depends_on:
|
|
migrate:
|
|
condition: service_completed_successfully
|
|
labels:
|
|
- traefik.enable=true
|
|
- traefik.docker.network=who_need_help_internal
|
|
- traefik.http.routers.who-need-help.rule=PathPrefix(`/`)
|
|
- traefik.http.routers.who-need-help.entrypoints=web
|
|
- traefik.http.services.who-need-help.loadbalancer.server.port=4000
|
|
healthcheck:
|
|
test: ["CMD", "curl", "--fail", "--silent", "http://localhost:4000/healthz/ready"]
|
|
interval: 10s
|
|
timeout: 3s
|
|
retries: 10
|
|
deploy:
|
|
replicas: 2
|
|
networks: [internal]
|
|
restart: unless-stopped
|
|
|
|
worker:
|
|
image: who-need-help:local
|
|
environment:
|
|
<<: *app-environment
|
|
APP_ROLE: worker
|
|
command: ["/app/bin/who_need_help", "start"]
|
|
depends_on:
|
|
migrate:
|
|
condition: service_completed_successfully
|
|
deploy:
|
|
replicas: 2
|
|
networks: [internal]
|
|
restart: unless-stopped
|
|
|
|
networks:
|
|
edge:
|
|
internal:
|
|
internal: true
|
|
|
|
volumes:
|
|
postgres_data:
|