forked from sparcs-kaist/biseo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
60 lines (57 loc) · 1.27 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
version: "3.9"
name: "biseo"
services:
web:
container_name: biseo-web
restart: always
build:
context: .
dockerfile: .docker/web.Dockerfile
ports:
- "${EXPOSE_PORT:?}:80"
environment:
- SERVER_URI="http://api:8000"
depends_on:
- api
networks:
- frontend
api:
container_name: biseo-api
restart: always
environment:
- NODE_ENV=production
- SERVER_PORT=8000
- DATABASE_URL=mysql://root:${DB_PASSWORD:?}@db:3306/${DB_NAME:?}
- SECRET_KEY=${SECRET_KEY:?}
build:
context: .
dockerfile: .docker/api.Dockerfile
depends_on:
db:
condition: service_healthy
networks:
- frontend
- backend
db:
container_name: biseo-db
restart: always
image: mysql:8.0
environment:
- MYSQL_ROOT_PASSWORD=${DB_PASSWORD:?}
- MYSQL_DATABASE=${DB_NAME:?}
volumes:
- biseo-data:/var/lib/mysql
command: --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci
networks:
- backend
healthcheck:
test: "mysql -uroot -p$$MYSQL_ROOT_PASSWORD $$MYSQL_DATABASE -e 'select 1'"
start_period: 0s
interval: 1s
retries: 3
volumes:
biseo-data:
external: true
networks:
frontend:
backend: