-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
48 lines (44 loc) · 974 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
48
version: '2.1'
services:
node-app:
build: .
image: node-app
restart: always
env_file:
- .env
ports:
- '3000:3000'
depends_on:
db:
condition: service_healthy
volumes:
- .:/usr/src/node-app
networks:
- node-network
db:
image: mysql:8
container_name: db-node-app
cap_add:
- ALL
command: [ '--default-authentication-plugin=mysql_native_password', '--character-set-server=utf8mb4', '--collation-server=utf8mb4_unicode_ci' ]
restart: always
ports:
- 3306:3306
environment:
MYSQL_DATABASE: ${DB_NAME}
MYSQL_USER: ${DB_USER}
MYSQL_PASSWORD: ${DB_PWD}
MYSQL_ROOT_PASSWORD: ${DB_ROOT_PWD}
healthcheck:
test: [ "CMD", "mysqladmin" ,"ping", "-h", "localhost" ]
timeout: 5s
retries: 20
volumes:
- dbdata:/data/db
networks:
- node-network
volumes:
dbdata:
networks:
node-network:
driver: bridge