-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
65 lines (63 loc) · 1.47 KB
/
Copy pathdocker-compose.yml
File metadata and controls
65 lines (63 loc) · 1.47 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
version: '3'
services:
chat_db:
image: mysql:5.7
container_name: chat_db
restart: always
env_file: .env
environment:
- MYSQL_DATABASE=$DATABASE_DB
- MYSQL_USER=$DATABASE_USERNAME
- MYSQL_PASSWORD=$DATABASE_PASSWORD
- MYSQL_ROOT_PASSWORD=$DATABASE_ROOT_PASSWORD
- MYSQL_PORT=$DATABASE_PORT
healthcheck:
test: ["CMD", "mysqladmin" ,"ping", "-h", "localhost"]
timeout: 20s
retries: 10
volumes:
- dbdata:/data/db
ports:
- "3306:3306"
expose:
- "3306"
networks:
- app-network
chat_app:
build:
context: .
dockerfile: docker/Dockerfile.nodejs
command: nodemon --legacy-watch src/app.ts
image: chat_app
container_name: chat_app
restart: unless-stopped
env_file: .env
environment:
- DB_HOST=$DATABASE_HOST
- DB_DATABASE=$DATABASE_DB
- DB_USERNAME=$DATABASE_USERNAME
- DB_PASSWORD=$DATABASE_PASSWORD
- DB_ROOT_PASSWORD=$DATABASE_ROOT_PASSWORD
- DB_PORT=$DATABASE_PORT
- WAIT_HOSTS=chat_db:3306
- WAIT_HOSTS_TIMEOUT=300
- WAIT_SLEEP_INTERVAL=30
- WAIT_HOST_CONNECT_TIMEOUT=30
ports:
- "8080:80"
depends_on:
chat_db:
condition: service_healthy
links:
- chat_db
volumes:
- .:/home/node/app
- node_modules:/home/node/app/node_modules
networks:
- app-network
networks:
app-network:
driver: bridge
volumes:
dbdata:
node_modules: