-
Notifications
You must be signed in to change notification settings - Fork 15
/
docker-compose-prod.yml
106 lines (106 loc) · 2.38 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
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
version: '3.8'
services:
app:
container_name: ${PREFIX}-app
build:
context: .
dockerfile: Dockerfile
target: production
image: ${PREFIX}-app
restart: always
env_file: .env
depends_on:
- db
- solr
- redis
ports:
- '3000:3000'
volumes:
- uploads:/code/public/system
- logs:/code/log
- ./config/tess.yml:/code/config/tess.yml
- ./config/secrets.yml:/code/config/secrets.yml
environment:
RAILS_ENV: production
RAILS_LOG_TO_STDOUT: 'true'
RAILS_SERVE_STATIC_FILES: 'true'
db:
container_name: ${PREFIX}-db
logging:
driver: none
image: postgres:14.2
restart: always
env_file: .env
environment:
PGDATA: /var/lib/postgresql/data
POSTGRES_DB: ${DB_NAME}
POSTGRES_USER: ${DB_USER}
POSTGRES_PASSWORD: ${DB_PASSWORD}
healthcheck:
test: pg_isready -U postgres -h 127.0.0.1
interval: 5s
volumes:
- db-data:/var/lib/postgresql/data
solr:
container_name: ${PREFIX}-solr
image: solr:8
restart: always
volumes:
- solr-data:/var/solr
- ./solr:/opt/solr/server/solr/configsets/production
command:
- solr-precreate
- tess
- /opt/solr/server/solr/configsets/production
redis:
container_name: ${PREFIX}-redis
image: redis:6
restart: always
healthcheck:
test: redis-cli ping
interval: 1s
timeout: 3s
retries: 30
volumes:
- redis-data:/data
sidekiq:
container_name: ${PREFIX}-sidekiq
build:
context: .
dockerfile: Dockerfile
target: production
image: ${PREFIX}-app
depends_on:
- app
- db
- redis
volumes:
- uploads:/code/public/system
- ./config/tess.yml:/code/config/tess.yml
- ./config/secrets.yml:/code/config/secrets.yml
env_file: .env
environment:
RAILS_ENV: production
command: bundle exec sidekiq
dbbackups:
container_name: ${PREFIX}-dbbackups
image: kartoza/pg-backup:14-3.1
volumes:
- db-backups:/backups
environment:
- POSTGRES_HOST=db
- POSTGRES_USER=${DB_USER}
- POSTGRES_PASS=${DB_PASSWORD}
- DBLIST=${DB_NAME}
- REMOVE_BEFORE=7
restart: on-failure
depends_on:
db:
condition: service_healthy
volumes:
db-data:
db-backups:
solr-data:
redis-data:
uploads:
logs: