-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yaml
64 lines (64 loc) · 1.48 KB
/
docker-compose.yaml
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
version: "3.8"
services:
db:
platform: linux/amd64
image: mysql:8.3
networks:
app_network:
ipv4_address: 192.168.92.23
restart: always
ports:
- $DB_PORT:$DB_PORT
environment:
- MYSQL_ROOT_PASSWORD=$DB_PASS
- MYSQL_DATABASE=$DB_NAME
- MYSQL_USER=user
- MYSQL_PASSWORD=$DB_PASS
- MYSQL_TCP_PORT=$DB_PORT
expose:
- $DB_PORT
volumes:
- db_data:/var/lib/mysql
library:
build:
context: .
dockerfile: Dockerfile
restart: always
ports:
- $WEB_PORT:$WEB_PORT
environment:
- WEB_PORT=$WEB_PORT
- DB_NAME=$DB_NAME
- DB_USER=$DB_USER
- DB_PASS=$DB_PASS
- DB_PORT=$DB_PORT
- DB_IPADDR=$DB_IPADDR
depends_on:
- db
networks:
app_network:
ipv4_address: 192.168.92.22
migrate:
image: migrate/migrate
networks:
app_network:
ipv4_address: 192.168.92.21
depends_on:
- db
volumes:
- ./database/migration:/migration
environment:
- DB_NAME=$DB_NAME
- DB_USER=$DB_USER
- DB_PASS=$DB_PASS
- DB_PORT=$DB_PORT
- DB_IPADDR=$DB_IPADDR
command: ["-path", "/migration", "-database", "mysql://$DB_USER:$DB_PASS@($DB_IPADDR:$DB_PORT)/$DB_NAME?parseTime=true", "-verbose", "up"]
volumes:
db_data:
networks:
app_network:
ipam:
driver: default
config:
- subnet: "192.168.92.0/24"