forked from amirhoseinsalimi/programmer-fa
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
55 lines (51 loc) · 912 Bytes
/
Copy pathdocker-compose.yml
File metadata and controls
55 lines (51 loc) · 912 Bytes
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
version: '3.7'
networks:
app-tier:
driver: bridge
services:
db:
image: "mariadb:latest"
volumes:
- $HOME/mariadb/data:/var/lib/mysql
- $HOME/mariadb/conf:/etc/mysql
env_file:
- .env
environment:
- MYSQL_ROOT_PASSWORD=${DB_PASSWORD}
- MYSQL_DATABASE=${DB_NAME}
- MYSQL_USER=${DB_USERNAME}
- MYSQL_PASSWORD=${DB_PASSWORD}
restart: always
ports:
- "3306:3306"
networks:
- app-tier
app:
build:
context: .
links:
- db
depends_on:
- db
restart: on-failure
command: npm start
networks:
- app-tier
migration:
build:
context: .
command:
[
"./wait-for-it/wait-for-it.sh",
"db:3306",
"--",
"npm",
"run",
"migrate:latest"
]
links:
- db
depends_on:
- db
networks:
- app-tier