-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
90 lines (88 loc) · 2.67 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
version: '3.0'
services:
sdschedule-database:
container_name: sdschedule-database
image: mariadb:latest
environment:
- "MYSQL_ROOT_PASSWORD=password"
- "MYSQL_USER=splanner"
- "MYSQL_PASSWORD=password"
- "MYSQL_DATABASE=classes"
volumes:
- "sdschedule-data:/var/lib/mysql"
restart: always
sdschedule-scraper:
container_name: sdschedule-scraper
image: ucsdplannerhelper/ucsd-schedule-planner:scraper
depends_on:
- "sdschedule-database"
environment:
- "PYTHONUNBUFFERED=0"
sdschedule-backend:
container_name: sdschedule-backend
image: ucsdplannerhelper/ucsd-schedule-planner:backend
ports:
- "5000:5000"
depends_on:
- "sdschedule-database"
volumes:
- "./config:/app/config"
- "sdschedule-sock:/app/sock"
environment:
- "ENV=DEV"
entrypoint:
- /app/wait-for
- sdschedule-database:3306
- --
- /app/backend
restart: always
sdschedule-frontend:
container_name: sdschedule-frontend
image: ucsdplannerhelper/ucsd-schedule-planner:frontend
depends_on:
- "sdschedule-backend"
volumes:
- "./frontend/src:/app/src"
- "./frontend/public:/app/public"
- "sdschedule-frontend-build:/app/build"
environment:
- "ENV=PROD"
restart: "no"
web:
container_name: sdschedule-web
image: nginx
ports:
- "80:80"
- "443:443"
depends_on:
- "sdschedule-frontend"
volumes:
- "sdschedule-frontend-build:/var/www/sdschedule"
- "sdschedule-sock:/tmp/sdschedule-sock"
- "./web/nginx/nginx.conf:/etc/nginx/nginx.conf:ro"
- "./web/nginx/sites:/etc/nginx/sites-enabled:ro"
- "./web/nginx/snippets:/etc/nginx/snippets:ro"
- "./web/html:/usr/share/nginx/html:ro"
- "./web/log:/var/log/nginx"
- "sdschedule-letsencrypt:/etc/letsencrypt:ro" # must keep sercret
- "./web/letsencrypt/www:/var/www/_letsencrypt:ro"
restart: always
command: sh -c 'while :; do sleep 12h; nginx -s reload; done & nginx -g "daemon off;"'
certbot:
container_name: sdschedule-certbot
image: certbot/certbot
restart: on-failure
volumes:
- "sdschedule-letsencrypt:/etc/letsencrypt" # must keep secret
- "./web/letsencrypt/www:/var/www/certbot"
- "./web/log:/var/log/certbot/"
- "./web/nginx/sites:/etc/nginx/sites-enabled"
# try renew every 20 days
entrypoint: sh -c "while :; do certbot renew; sleep 20d; done >> /var/log/certbot/certbot.log;"
# cleaner:
# TODO: need a thing to cleanup logs, compress and remove
volumes:
sdschedule-letsencrypt:
sdschedule-data:
sdschedule-frontend-build:
sdschedule-sock: