-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathdocker-compose.yaml
67 lines (63 loc) · 1.49 KB
/
docker-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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
services:
sidekiq: &sidekiq
tty: true
stdin_open: true
env_file: .env
build:
context: .
args:
CONTAINER_GID: '${CONTAINER_GID:-1000}'
CONTAINER_UID: '${CONTAINER_UID:-1000}'
restart: unless-stopped
user: $CONTAINER_UID:$CONTAINER_GID
volumes:
- ./:/opt/app/src/
command: bundle exec sidekiq -C config/sidekiq.yml
depends_on:
- database
- cache
app:
<<: *sidekiq
command: ./start.sh
environment:
DISABLE_DATABASE_ENVIRONMENT_CHECK: 1
ports:
- 3000:3000
healthcheck:
test: ["CMD", "curl", "-f", "-o", "/dev/null", "http://127.0.0.1:3000/ping"]
interval: 10s
timeout: 5s
retries: 6
start_period: 5s
guard:
<<: *sidekiq
env_file: .env.test
environment:
RAILS_ENV: test
command: sh -c "bundle exec rails db:migrate && bundle exec guard start --no-bundler-warning"
cache:
image: redis:alpine
ulimits:
memlock: -1
restart: unless-stopped
ports:
- 6379:6379
healthcheck:
test: redis-cli ping
interval: 10s
timeout: 3s
retries: 30
database:
image: postgres:alpine
env_file: .env.test
environment:
POSTGRES_USER: ${DATABASE_USERNAME}
POSTGRES_PASSWORD: ${DATABASE_PASSWORD}
POSTGRES_DB: ${DATABASE_NAME}
ports:
- 5432:5432
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${DATABASE_USERNAME}"]
interval: 10s
timeout: 5s
retries: 30