-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
78 lines (74 loc) · 2.61 KB
/
Copy pathdocker-compose.yml
File metadata and controls
78 lines (74 loc) · 2.61 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
# Dokploy compose stack (spec §3): single app container serving SPA + API, plus
# Postgres. POSTGRES_USER / POSTGRES_PASSWORD / POSTGRES_DB all match the project
# name. Set secrets (CODE_SECRET, POSTGRES_PASSWORD, DISCORD_WEBHOOK_URL) in the
# Dokploy environment UI — do not commit them.
services:
app:
build:
context: .
args:
VITE_AUTH_URL: ${VITE_AUTH_URL:-https://auth.monashcoding.com}
restart: unless-stopped
environment:
DATABASE_URL: postgres://mac_membership_verify:${POSTGRES_PASSWORD:-mac_membership_verify}@db:5432/mac_membership_verify
AUTH_URL: ${AUTH_URL:-https://auth.monashcoding.com}
JWT_AUDIENCE: ${JWT_AUDIENCE:-mac-suite}
MAC_ADMIN_ROLES: ${MAC_ADMIN_ROLES:-exec,committee}
CODE_SECRET: ${CODE_SECRET:?set a strong CODE_SECRET in the Dokploy env}
CODE_PREFIX: ${CODE_PREFIX:-MAC}
DISCORD_WEBHOOK_URL: ${DISCORD_WEBHOOK_URL:-}
HUMANITIX_API_KEY: ${HUMANITIX_API_KEY:-}
PORT: "3000"
depends_on:
db:
condition: service_healthy
# No host port on the shared Dokploy VM (collides with other apps). Instead the
# app joins Dokploy's Traefik network and declares routing via labels below.
expose:
- "3000"
networks:
# Reachable by Dokploy's Traefik proxy…
- dokploy-network
# …and a private network to talk to Postgres.
- internal
labels:
- traefik.enable=true
- traefik.docker.network=dokploy-network
- traefik.http.routers.verify.rule=Host(`${APP_DOMAIN:-verify.monashcoding.com}`)
- traefik.http.routers.verify.entrypoints=websecure
- traefik.http.routers.verify.tls.certresolver=letsencrypt
- traefik.http.services.verify.loadbalancer.server.port=3000
healthcheck:
test:
- CMD
- node
- -e
- "fetch('http://localhost:3000/api/health').then(r=>process.exit(r.ok?0:1)).catch(()=>process.exit(1))"
interval: 30s
timeout: 5s
retries: 3
start_period: 20s
db:
image: postgres:16-alpine
restart: unless-stopped
environment:
POSTGRES_USER: mac_membership_verify
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-mac_membership_verify}
POSTGRES_DB: mac_membership_verify
volumes:
- db-data:/var/lib/postgresql/data
networks:
- internal
healthcheck:
test: ["CMD-SHELL", "pg_isready -U mac_membership_verify"]
interval: 10s
timeout: 5s
retries: 5
volumes:
db-data:
networks:
# Dokploy's shared proxy network — created by Dokploy, so we join it as external.
dokploy-network:
external: true
internal:
driver: bridge