-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
73 lines (68 loc) · 1.42 KB
/
docker-compose.yml
File metadata and controls
73 lines (68 loc) · 1.42 KB
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
# version: '3.8'
services:
client:
build:
context: ./client
ports:
- "5000:5000"
depends_on:
- server
- api
env_file:
- ./client/.env.local
volumes:
- ./client:/app
- /app/node_modules # avoid overwriting node_modules
working_dir: /app
environment:
- CHOKIDAR_USEPOLLING=true # important for file watching in Docker
command: npm run dev
server:
build:
context: ./server
ports:
- "3000:3000"
env_file:
- ./server/.env
depends_on:
- mysql
- api
volumes:
- ./server:/app
- /app/node_modules
working_dir: /app
environment:
- CHOKIDAR_USEPOLLING=true
command: npm start
api:
build:
shm_size: '2gb'
context: ./api
env_file:
- ./api/.env
ports:
- "8000:8000"
volumes:
- ./api:/app
environment:
- FLASK_ENV=development
mysql:
image: mysql:8.0
ports:
- "3307:3306"
environment:
- MYSQL_ROOT_PASSWORD="${DB_ROOT_PASSWORD}"
- MYSQL_DATABASE=${DB_NAME}
- MYSQL_USER=${DB_USER}
- MYSQL_PASSWORD=${DB_PASSWORD}
volumes:
- mysql_data:/var/lib/mysql
- ./init.sql:/docker-entrypoint-initdb.d/init.sql
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "localhost"]
timeout: 20s
retries: 10
restart: unless-stopped
volumes:
mysql_data:
driver: local