-
Notifications
You must be signed in to change notification settings - Fork 3
/
docker-compose.yml
139 lines (128 loc) · 3.1 KB
/
docker-compose.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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
# docker-compose.yml
version: '3.8'
networks:
sapi:
driver: bridge
services:
db:
container_name: sapi-db
image: postgres:10
command: postgres -c max_wal_size=2GB
healthcheck:
test: ["CMD", "pg_isready", "-U", "postgres"]
timeout: 45s
interval: 10s
retries: 10
volumes:
- 'pgdata:/var/lib/postgresql/data'
ports:
- "${SAPI_CONTAINER_DB_PORT:-5432}:5432"
networks:
- sapi
environment:
POSTGRES_HOST_AUTH_METHOD: "trust"
POSTGRES_DB: "sapi_development"
deploy:
container_name: sapi-cap-deploy
build:
context: ./
dockerfile: Dockerfile.cap-deploy
volumes:
- '.:/SAPI'
- bundler_gems:/usr/local/bundle
networks:
- sapi
stdin_open: true
tty: true
environment:
SAPI_DATABASE_HOST: sapi-db
SAPI_SIDEKIQ_REDIS_URL: redis://sapi-redis:6379/0
# Defaults to blank; used by AppSignal:
USER: "$USER"
USERNAME: "$USERNAME"
secrets:
- host_ssh_key
- host_ssh_config
rails:
container_name: sapi-rails
build:
context: ./
dockerfile: Dockerfile
command: /bin/bash -l -c "rm -f ./tmp/pids/server.pid && bundle install && bundle exec rails s -p 3000 -b '0.0.0.0'"
volumes:
- '.:/SAPI'
- bundler_gems:/usr/local/bundle
ports:
- '${SAPI_CONTAINER_RAILS_PORT:-3000}:3000'
networks:
- sapi
stdin_open: true
tty: true
environment:
MAILER_ADDRESS: sapi-mailcatcher
MEMCACHE_SERVERS: sapi-memcached:11211
SAPI_DATABASE_HOST: sapi-db
SAPI_DATABASE_USERNAME: postgres
SAPI_DATABASE_PORT: 5432
SAPI_SIDEKIQ_REDIS_URL: redis://sapi-redis:6379/0
depends_on:
- redis
- db
- mailcatcher
- memcached
redis:
container_name: sapi-redis
image: redis:7.2.0
ports:
- "${SAPI_CONTAINER_REDIS_PORT:-6379}:6379"
networks:
- sapi
command: redis-server --save 20 1 --loglevel warning
volumes:
- redis_data:/data
sidekiq:
container_name: sapi-sidekiq
build:
context: .
dockerfile: Dockerfile
networks:
- sapi
depends_on:
- db
- redis
- mailcatcher
- memcached
command: /bin/bash -l -c "bundle install && bundle exec sidekiq -C config/sidekiq.yml"
volumes:
- '.:/SAPI'
- bundler_gems:/usr/local/bundle
environment:
MAILER_ADDRESS: sapi-mailcatcher
MEMCACHE_SERVERS: sapi-memcached:11211
SAPI_DATABASE_HOST: sapi-db
SAPI_DATABASE_USERNAME: postgres
SAPI_DATABASE_PORT: 5432
SAPI_SIDEKIQ_REDIS_URL: redis://sapi-redis:6379/0
mailcatcher:
container_name: sapi-mailcatcher
image: sj26/mailcatcher
ports:
- "${SAPI_CONTAINER_MAILCATCHER_PORT:-1080}:1080"
networks:
- sapi
memcached:
container_name: sapi-memcached
image: memcached:1.6
ports:
- "${SAPI_CONTAINER_MEMCACHE_PORT:-11211}:11211"
networks:
- sapi
volumes:
pgdata:
bundler_gems:
redis_data:
secrets:
host_ssh_key:
file: ~/.ssh/id_ed25519
host_ssh_config:
file: ~/.ssh/config