-
Notifications
You must be signed in to change notification settings - Fork 4
/
docker-compose.prod.yml
61 lines (57 loc) · 1.34 KB
/
docker-compose.prod.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
version: "3.8"
services:
nginx:
image: nginx:alpine
ports:
- "80:80"
- "443:443"
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf:ro
- ./certs:/etc/nginx/certs:ro
- ./public:/rails/public:ro
depends_on:
- web
web: &web
env_file:
- .env
build:
context: .
args:
RAILS_ENV: production
environment:
- RAILS_ENV=production
- REDIS_URL=redis://redis-db:6379
- DATABASE_URL=postgres://root:password@postgres-db/qae_production
depends_on:
postgres-db:
condition: service_healthy
redis-db:
condition: service_started
command: /rails/bin/rails server -b 0.0.0.0
entrypoint: ["/rails/bin/docker-entrypoint"]
expose:
- "3000"
postgres-db:
image: postgres
environment:
POSTGRES_USER: root
POSTGRES_PASSWORD: password
POSTGRES_DB: qae_production
volumes:
- ./tmp/postgres-db:/var/lib/postgresql/data
- ./init-hstore.sql:/docker-entrypoint-initdb.d/init-hstore.sql
healthcheck:
test: ["CMD-SHELL", "pg_isready -U root -d qae_production"]
interval: 5s
timeout: 5s
retries: 5
ports:
- "5432:5432"
restart: unless-stopped
redis-db:
image: redis
ports:
- "6379:6379"
sidekiq:
<<: *web
command: bundle exec sidekiq