-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.prod.yml
More file actions
54 lines (50 loc) · 1.31 KB
/
Copy pathdocker-compose.prod.yml
File metadata and controls
54 lines (50 loc) · 1.31 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
version: '3.8'
services:
app:
build: .
container_name: tracker_app_production
environment:
- RAILS_ENV=production
- DATABASE_URL=postgres://tracker:${TRACKER_DATABASE_PASSWORD}@postgres:5432/tracker_production
- REDIS_URL=redis://redis:6379/0
- RAILS_MASTER_KEY=${RAILS_MASTER_KEY}
ports:
- "3000:3000"
volumes:
- ./public:/app/public
- ./storage:/app/storage
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
command: bundle exec rails server -b 0.0.0.0
postgres:
image: postgres:16
container_name: tracker_postgres_production
environment:
POSTGRES_DB: tracker_production
POSTGRES_USER: tracker
POSTGRES_PASSWORD: ${TRACKER_DATABASE_PASSWORD}
volumes:
- postgres_data:/var/lib/postgresql/data
restart: unless-stopped
healthcheck:
test: ["CMD-SHELL", "pg_isready -U tracker -d tracker_production"]
interval: 10s
timeout: 5s
retries: 5
redis:
image: redis:7-alpine
container_name: tracker_redis_production
volumes:
- redis_data:/data
restart: unless-stopped
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 5
volumes:
postgres_data:
redis_data: