-
Notifications
You must be signed in to change notification settings - Fork 5
/
docker-compose.yml
66 lines (60 loc) · 1.53 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
x-adopter: &adopter
build: .
volumes:
- .:/app
env_file: .env.docker
environment:
RAILS_ENV: production
RAILS_LOG_TO_STDOUT: true
RAILS_SERVE_STATIC_FILES: true
DATABASE_URL: postgres://postgres:postgres@db:5442/adopter_production
REDIS_URL: redis://redis:6389/1
depends_on:
- db
- redis
services:
db:
image: postgres:16.0-alpine
volumes:
- postgres_data:/var/lib/postgresql/data/
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: adopter_production
PGPORT: 5442
command: postgres -c shared_preload_libraries=pg_stat_statements -c pg_stat_statements.track=all
ports:
- 5442:5442
redis:
image: redis:6.0.9-alpine
command: redis-server
ports:
- 6389:6379
web:
<<: *adopter
command: bin/rails server -p 3001 -e production
environment:
- APPSIGNAL_PUSH_API_KEY=${APPSIGNAL_PUSH_API_KEY}
- RAILS_LOG_TO_STDOUT=true
ports:
- 3001:3001
expose:
- 3001
env_file: .env.docker
db_migrate:
<<: *adopter
command: bin/rails db:migrate db:seed assets:precompile generate:data
env_file: .env.docker
traffic:
<<: *adopter
command: bin/rake traffic:go[web:3000]
deploy:
replicas: 4 # decrease to 1 or 2 if you have slow computer
environment:
TRAFFIC_GENERATOR_SLEEP_TIME: 1 # increase to 5 or 10 if you have slow computer
TRAFFIC_GENERATOR_HOST: web:3001
depends_on:
- web
volumes:
postgres_data:
driver: local