-
Notifications
You must be signed in to change notification settings - Fork 2
/
docker-compose.yaml
52 lines (51 loc) · 1.14 KB
/
docker-compose.yaml
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
# docker는 개발 환경 구축 및 테스트 용도로 사용
version: "3.7"
services:
base:
image: ${APP_NAME}-base:latest
build:
context: .
dockerfile: base.Dockerfile
container_name: base
command: python3 -V
database:
image: mysql:8.0
hostname: mysql
restart: always
ports:
- 3306:3306
env_file:
- ./infra/mysql.env
volumes:
- type: bind
source: ./infra/init_sql
target: /docker-entrypoint-initdb.d
- type: bind
source: ./infra/mysql-files
target: /var/lib/mysql-files
- type: bind
source: ./infra/my.cnf
target: /etc/mysql/my.cnf
app:
image: ${APP_NAME}:latest
build:
context: .
dockerfile: app.Dockerfile
hostname: ${APP_NAME}
container_name: ${APP_NAME}
env_file:
- ${PWD}/.env
environment:
- HOST=${HOST}
- MYSQL_USER=deo
- MYSQL_PASSWORD=imdeo
- MYSQL_ROOT_PASSWORD=imdeo
- MYSQL_HOST=database
- MYSQL_DATABASE=todolist
tty: true
restart: always
depends_on:
- "base"
- "database"
ports:
- ${PORT}:${PORT}