-
Notifications
You must be signed in to change notification settings - Fork 17
/
docker-compose.yaml
72 lines (64 loc) · 1.38 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
version: "3"
x-dev-base: &dev-base
build: .
environment:
DATABASE_URL: mysql://docker:docker@mysql:3306/nest_next_sample
SERVER_APOLLO_URI: http://backend:3300
PUBLIC_APOLLO_URI: http://localhost:3300
TZ: Asia/Tokyo
volumes:
- .:/app
- /app/node_modules
- /app/packages/backend/node_modules
- /app/packages/frontend/node_modules
services:
mysql:
image: mysql:8.0
command: mysqld
environment:
MYSQL_ROOT_PASSWORD: root
MYSQL_USER: docker
MYSQL_PASSWORD: docker
MYSQL_DATABASE: nest_next_sample
TZ: 'Asia/Tokyo'
ports:
- 4306:3306
volumes:
- ./docker/db/data:/var/lib/mysql
- ./docker/db/my.cnf:/etc/mysql/conf.d/my.cnf
migrate:
<< : *dev-base
working_dir: /app/packages/backend
command: yarn migrate:deploy
depends_on:
- mysql
backend:
<< : *dev-base
working_dir: /app/packages/backend
command: yarn start:dev
tty: true
depends_on:
- mysql
- migrate
ports:
- "3300:3300"
backend-prod:
<< : *dev-base
build:
context: .
dockerfile: Dockerfile.prod
tty: true
depends_on:
- mysql
- migrate
ports:
- "3300:3300"
frontend:
<< : *dev-base
working_dir: /app/packages/frontend
command: yarn dev
tty: true
depends_on:
- backend
ports:
- "3000:3000"