-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose.yml
74 lines (73 loc) · 1.8 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
version: "3.9"
services:
web:
container_name: quizme_web
image: "${FRONTEND_IMAGE}"
platform: ${PLATFORM}
build:
context: ./frontend
ports:
- "1306:1306"
depends_on:
- backend
networks:
- app-network
nginx:
container_name: quizme_ngnix
image: nginx:latest
build:
context: ./nginx
volumes:
- ./nginx/nginx.conf:/etc/nginx/nginx.conf
- ./certbot/www:/var/www/certbot
- ./letsencrpt:/etc/nginx/ssl
ports:
- "80:80"
- "443:443"
depends_on:
- web
networks:
- app-network
backend:
container_name: quizme_backend
platform: "${PLATFORM}"
image: "${BACKEND_IMAGE}"
build:
context: ./backend
environment:
DB_PORT: "${DB_PORT}"
DB_USER: "${DB_USER}"
DB_PASSWORD: "${DB_PASS}"
DB_NAME: "${DB_NAME}"
DATABASE_URL: "${DATABASE_URL}"
AWS_ACCESS_KEY: "${AWS_ACCESS_KEY}"
AWS_ACCESS_SECRET: "${AWS_ACCESS_SECRET}"
AWS_REGION: "${AWS_REGION}"
AWS_IMAGE_BUCKET: "${AWS_IMAGE_BUCKET}"
ports:
- "7001:7001" # Expose port 7001 on host
# depends_on only guarantee database service run before backend service, but not guarantee the database service is ready.
depends_on:
- db
networks:
- app-network
volumes:
- ${BACKEND_LOGDIR}:/app/logs/prod
db:
container_name: quizme_db
image: mysql
platform: ${PLATFORM}
environment:
MYSQL_ROOT_PASSWORD: "${DB_ROOT_PASS}"
MYSQL_DATABASE: "${DB_NAME}"
MYSQL_USER: "${DB_USER}"
MYSQL_PASSWORD: "${DB_PASS}"
ports:
- "3306:3306" # Expose port 3306
networks:
- app-network
volumes:
- ${DB_DIR}:/var/lib/mysql
networks: # Specify the network for bridging
app-network:
driver: bridge