-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
101 lines (96 loc) · 2.66 KB
/
docker-compose.yml
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
services:
planner:
image: registry.sccs.swarthmore.edu/sccs/planner/planner:latest
build:
context: .
dockerfile: ./Dockerfile
restart: unless-stopped
env_file:
- .env
environment:
NODE_ENV: production
DOMAIN: https://plan.sccs.swarthmore.edu
depends_on:
- planner-db
deploy:
labels:
- "traefik.enable=true"
- "traefik.docker.network=traefik"
- "traefik.http.routers.planner.entrypoints=https"
- "traefik.http.routers.planner.rule=Host(`plan.sccs.swarthmore.edu`)"
- "traefik.http.routers.planner.tls=true"
- "traefik.http.routers.planner.tls.certresolver=letsEncrypt"
- "traefik.http.services.planner.loadbalancer.server.port=3000"
command: sh -c "sleep 5 && npx prisma migrate deploy && npm start "
networks:
- traefik
- internal
planner-db:
hostname: planner-db
image: postgres:16.4-bullseye
volumes:
- planner-dbdata:/var/lib/postgresql/data
env_file:
- .env
ports:
- 5432:5432
networks:
- internal
planner-pgadmin:
image: dpage/pgadmin4
container_name: planner-pgadmin
restart: always
ports:
- 8888:8888
env_file:
- .env
environment:
SCRIPT_NAME: /pgadmin
deploy:
labels:
- "traefik.enable=true"
- "traefik.docker.network=traefik"
- "traefik.http.routers.planner_pgadmin.entrypoints=https"
- "traefik.http.routers.planner_pgadmin.rule=Host(`plan.sccs.swarthmore.edu`) && PathPrefix(`/pgadmin`)"
- "traefik.http.routers.planner_pgadmin.tls=true"
- "traefik.http.routers.planner_pgadmin.tls.certresolver=letsEncrypt"
- "traefik.http.services.planner_pgadmin.loadbalancer.server.port=8888"
depends_on:
- planner-db
networks:
- internal
- traefik
volumes:
- planner-pgadmindata:/var/lib/pgadmin
planner-cron:
image: registry.sccs.swarthmore.edu/sccs/planner-cron/planner-cron:latest
build:
context: .
dockerfile: ./Dockerfile.cron
restart: unless-stopped
env_file:
- .env
depends_on:
- planner-db
networks:
- internal
# (re)define traefik proxy network
networks:
internal:
driver: overlay
traefik:
# defined elsewhere
external: true
volumes:
planner-dbdata:
name: planner-dbdata
driver_opts:
type: nfs
o: "nfsvers=4,addr=130.58.218.26,rw,nolock,soft"
device: ":/volumes/scheduler-dbdata"
planner-pgadmindata:
name: planner-pgadmindata
driver_opts:
type: nfs
o: "nfsvers=4,addr=130.58.218.26,rw,nolock,soft"
device: ":/volumes/planner-pgadmindata"