This repository has been archived by the owner on Jul 7, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose.staging.yml
78 lines (72 loc) · 1.77 KB
/
docker-compose.staging.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
72
73
74
75
76
77
78
version: '3.1'
volumes:
redis:
postgres:
assets:
services:
db:
image: postgres:9.6
expose:
- 5432
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: projectname_staging
volumes:
- postgres:/var/lib/postgresql/data
healthcheck:
test: ["CMD", "pg_isready", "-U", "postgres"]
in_memory_store:
image: redis:3.2-alpine
expose:
- 6379
volumes:
- redis:/var/lib/redis/data
healthcheck:
test: ["CMD", "redis-cli", "-h", "localhost", "ping"]
server_app: &server_app
build: .
command: bundle exec puma -C config/puma.rb
entrypoint: "./docker-entrypoint.sh"
volumes:
- assets:/home/www/projectname/public/assets
environment:
RAILS_ENV: staging
DB_HOST: db
DB_PORT: 5432
DB_NAME: projectname_staging
DB_USERNAME: postgres
DB_PASSWORD: postgres
REDIS_DB: "redis://in_memory_store:6379"
SECRET_KEY_BASE: STUB
DEVISE_SECRET_KEY: STUB
depends_on:
- db
- in_memory_store
expose:
- 3000
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:3000"]
server_worker_app:
<<: *server_app
command: bundle exec sidekiq -C config/sidekiq.yml
entrypoint: ''
depends_on:
- db
- server_app
- in_memory_store
healthcheck:
test: ["CMD-SHELL", "ps ax | grep -v grep | grep sidekiq || exit 1"]
web_server:
build: ./deploy/configs/nginx
volumes:
- assets:/home/www/projectname/public/assets
environment:
CUSTOM_APP_VHOST: server_app
ROOT_PATH: /home/www/projectname/public
ports:
- 80:8080
depends_on:
- server_app
healthcheck:
test: ["CMD-SHELL", "service nginx status || exit 1"]