-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcompose.yaml
44 lines (42 loc) · 1.05 KB
/
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
# To build for a version of ruby and active_record, run e.g.:
# docker compose build --build-arg ruby_version=3.0.6 --build-arg activerecord_version=6.1
# docker compose run --rm app bash
# docker compose down
services:
app:
build:
dockerfile: Dockerfile
args:
- ruby_version=3.0.6
- activerecord_version=6.1
depends_on:
mysql:
condition: service_healthy
postgres:
condition: service_healthy
mysql:
platform: linux/amd64
image: mysql:8-debian
environment:
- MYSQL_ROOT_PASSWORD=Password123
volumes:
- mysqldata:/var/lib/mysql
healthcheck:
test: ["CMD-SHELL", "exit | mysql -h localhost -P 3306 -u root -pPassword123" ]
interval: 2s
timeout: 5s
retries: 15
postgres:
image: postgres:16-alpine
environment:
- POSTGRES_PASSWORD=Password123
volumes:
- pgdata:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready"]
interval: 2s
timeout: 5s
retries: 15
volumes:
mysqldata:
pgdata: