-
Notifications
You must be signed in to change notification settings - Fork 0
/
compose.yml
71 lines (68 loc) · 1.95 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
services:
# Rails application
web:
container_name: kudo-o-matic_web
build:
context: .
dockerfile: ./dockerfiles/development/web/Dockerfile
ports:
- "${WEB_PORT_LOCAL:-3000}:3000"
volumes:
- .:/code
depends_on:
db:
condition: service_healthy
db-test:
condition: service_healthy
redis:
condition: service_healthy
command: bash -c "bundle install
&& bundle exec rake db:migrate
&& bundle exec puma"
healthcheck:
test: curl --fail http://localhost:3000 || exit 1
interval: 20s
retries: 5
start_period: 20s
timeout: 10s
# Postgres
db:
image: postgres:16
environment:
POSTGRES_USER: "${DATABASE_USER:-kudo_user}"
POSTGRES_PASSWORD: "${DATABASE_PASSWORD:-kudos}"
POSTGRES_DB: "${DATABASE_NAME:-kudo-o-matic_development}"
healthcheck:
test: pg_isready -d $${POSTGRES_DB} -U $$POSTGRES_USER
interval: 5s
timeout: 10s
retries: 10
ports:
- "${DATABASE_PORT_LOCAL:-9001}:5432"
volumes:
# Init script that creates a database from the dump file listed below if no database exists yet
- ./dockerfiles/development/db/init.sh:/docker-entrypoint-initdb.d/init.sh
# Data volume for persistent storage
- ./dockerfiles/development/db/data:/var/lib/postgresql/data
db-test:
image: postgres:16
environment:
POSTGRES_USER: "${DATABASE_USER:-kudo_user}"
POSTGRES_PASSWORD: "${DATABASE_PASSWORD:-kudos}"
POSTGRES_DB: "${TEST_DATABASE_NAME:-kudo-o-matic_test}"
healthcheck:
test: pg_isready -d $${POSTGRES_DB} -U $$POSTGRES_USER
interval: 5s
timeout: 10s
retries: 10
ports:
- "${DATABASE_PORT_LOCAL:-9002}:5432"
redis:
image: redis:7
ports:
- "${REDIS_PORT_LOCAL:-6379}:6379"
healthcheck:
test: ["CMD", "redis-cli", "--raw", "incr", "ping"]
interval: 1s
timeout: 3s
retries: 5