-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.mysql.yml
More file actions
42 lines (40 loc) · 1.03 KB
/
docker-compose.mysql.yml
File metadata and controls
42 lines (40 loc) · 1.03 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
services:
mysql:
image: mysql:8.0
environment:
MYSQL_ROOT_PASSWORD: password
MYSQL_DATABASE: better_structure_sql_mysql_development
ports:
- "3306:3306"
volumes:
- mysql_data:/var/lib/mysql
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "-ppassword"]
interval: 5s
timeout: 5s
retries: 10
command: --default-authentication-plugin=mysql_native_password
web_mysql:
build:
context: .
dockerfile: Dockerfile.mysql
depends_on:
mysql:
condition: service_healthy
environment:
DB_ADAPTER: mysql2
DB_HOST: mysql
DB_PORT: 3306
DB_USERNAME: root
DB_PASSWORD: password
RAILS_ENV: development
ports:
- "3001:3000"
volumes:
- .:/app
- bundle_cache_mysql:/usr/local/bundle
working_dir: /app/integration_mysql
command: sh -c "bundle install && bundle exec rails db:create db:migrate && bundle exec rails server -b 0.0.0.0"
volumes:
mysql_data:
bundle_cache_mysql: