-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
60 lines (58 loc) · 1.77 KB
/
docker-compose.yml
File metadata and controls
60 lines (58 loc) · 1.77 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
services:
db:
image: postgres:15-alpine
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: task_tracker_production
POSTGRES_MULTIPLE_DATABASES: task_tracker_production_cache,task_tracker_production_queue,task_tracker_production_cable
volumes:
- postgres_data:/var/lib/postgresql/data
- ./docker/init-databases.sh:/docker-entrypoint-initdb.d/init-databases.sh
healthcheck:
test: [ "CMD-SHELL", "pg_isready -U postgres" ]
interval: 10s
timeout: 5s
retries: 5
web:
build: .
command: >
sh -c "bin/rails db:prepare &&
./bin/thrust ./bin/rails server -b 0.0.0.0"
environment:
RAILS_ENV: production
DATABASE_URL: postgres://postgres:postgres@db:5432/task_tracker_production
CACHE_DATABASE_URL: postgres://postgres:postgres@db:5432/task_tracker_production_cache
QUEUE_DATABASE_URL: postgres://postgres:postgres@db:5432/task_tracker_production_queue
CABLE_DATABASE_URL: postgres://postgres:postgres@db:5432/task_tracker_production_cable
RAILS_MASTER_KEY: ${RAILS_MASTER_KEY}
RAILS_LOG_TO_STDOUT: "true"
RAILS_SERVE_STATIC_FILES: "true"
SOLID_QUEUE_IN_PUMA: "true"
PORT: "80"
ports:
- "3003:80"
depends_on:
db:
condition: service_healthy
volumes:
- storage_data:/rails/storage
tmpfs:
- /rails/tmp/cache
- /rails/tmp/pids
healthcheck:
test: [ "CMD-SHELL", "curl -f http://localhost:80/up || exit 1" ]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
deploy:
resources:
limits:
memory: 512M
reservations:
memory: 256M
restart: unless-stopped
volumes:
postgres_data:
storage_data: