-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
47 lines (44 loc) · 1013 Bytes
/
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
version: '3'
services:
mysql:
image: mysql:latest
command: --innodb-use-native-aio=0
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "-uuser", "-ppassword"]
interval: 5s
timeout: 3s
retries: 3
environment:
MYSQL_USER: admin
MYSQL_PASSWORD: admin
MYSQL_DATABASE: people_db
MYSQL_ALLOW_EMPTY_PASSWORD: false
volumes:
- ./mysql/init.sql:/docker-entrypoint-initdb.d/init.sql
ports:
- 3306:3306
nodejs:
build:
context: nodejs
working_dir: /app
volumes:
- ./nodejs:/app
command: bash -c "npm install && node server.js"
environment:
- DB_HOST=mysql
- DB_USER=admin
- DB_PASSWORD=admin
- DB_NAME=people_db
depends_on:
mysql:
condition: service_healthy
ports:
- 3000:3000
nginx:
image: nginx:latest
ports:
- "8080:80"
volumes:
- ./nginx/nginx.conf:/etc/nginx/nginx.conf
depends_on:
- nodejs