-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
120 lines (112 loc) · 2.39 KB
/
Copy pathdocker-compose.yml
File metadata and controls
120 lines (112 loc) · 2.39 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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
x-default-logging: &default-logging
driver: local
options:
max-size: "5m"
max-file: "3"
x-volumes:
src: &vol-src
type: bind
source: ./src
target: /src
example: &vol-example
type: bind
source: ./example
target: /example
vendor: &vol-vendor
type: bind
source: ./vendor
target: /vendor
read_only: true
name: migrator
services:
app:
container_name: migrator_app
build:
context: .docker/php/cli
target: devel
args:
UID: ${USER:-1} # ID:1 daemon, support: linux, mac
WORKDIR: "/example"
depends_on:
postgres:
condition: service_healthy
mysql:
condition: service_healthy
networks:
- migrator
volumes:
- *vol-src
- *vol-example
- *vol-vendor
logging: *default-logging
postgres:
container_name: migrator_postgres
build:
context: .docker/postgresql
deploy:
resources:
limits:
cpus: "1.0"
memory: 512M
reservations:
cpus: "0.5"
memory: 256M
ports:
- "5435:5432"
environment:
- POSTGRES_DB=main
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
networks:
- migrator
volumes:
- pg_data:/var/lib/postgresql/data
healthcheck:
test: "pg_isready -U \"$$POSTGRES_USER\" -d \"$$POSTGRES_DB\""
interval: 5s
timeout: 5s
retries: 5
start_period: 2s
start_interval: 1s
logging: *default-logging
mysql:
container_name: migrator_mysql
build:
context: .docker/mysql
cap_add:
- SYS_NICE # CAP_SYS_NICE
deploy:
resources:
limits:
cpus: "1.0"
memory: 512M
reservations:
cpus: "0.5"
memory: 256M
ports:
- "3306:3306"
networks:
- migrator
command: [
'--character-set-server=utf8mb4',
'--collation-server=utf8mb4_unicode_ci'
]
environment:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: main
MYSQL_USER: dbuser
MYSQL_PASSWORD: dbpassword
volumes:
- mysql_data:/var/lib/mysql
healthcheck:
test: [ "CMD", "mysqladmin", "ping", "-h", "localhost", "-u", "root", "-proot" ]
interval: 10s
timeout: 5s
retries: 5
start_period: 10s
logging: *default-logging
volumes:
pg_data:
mysql_data:
networks:
migrator: