-
Notifications
You must be signed in to change notification settings - Fork 3
/
compose.yml
51 lines (50 loc) · 1.18 KB
/
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
49
50
51
services:
mysql:
image: mysql:8.0
environment:
MYSQL_RANDOM_ROOT_PASSWORD: "yes"
volumes:
- mysqlsockdir:/var/run/mysqld
- mysqlvol:/var/lib/mysql
configs:
- source: init_sql
target: /docker-entrypoint-initdb.d/init-mysql-docker-compose.sql
- source: mysql_cnf
target: /etc/mysql/conf.d/docker-mysql.cnf
network_mode: none
healthcheck:
test: ["CMD", "mysqladmin" ,"ping", "-h", "localhost"]
interval: 1s
timeout: 2s
retries: 10
rails-init-db:
build: .
volumes:
- mysqlsockdir:/var/run/mysqld
depends_on:
mysql:
condition: service_healthy
command: ["/app/bin/init"]
rails:
build: .
volumes:
- mysqlsockdir:/var/run/mysqld
- ./app:/app/app:ro
- ./bin:/app/bin:ro
- ./config:/app/config:ro
- ./public:/app/public:ro
ports:
- "3000:3000"
network_mode: bridge
depends_on:
rails-init-db:
condition: service_completed_successfully
command: rails s -p 3000 -b 0.0.0.0
configs:
init_sql:
file: init-mysql-docker-compose.sql
mysql_cnf:
file: docker-mysql.cnf
volumes:
mysqlsockdir:
mysqlvol: