-
Notifications
You must be signed in to change notification settings - Fork 14
/
docker-compose.yml
124 lines (124 loc) · 2.7 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
version: '3.8'
services:
app:
container_name: ${PREFIX}-app
build:
context: .
dockerfile: Dockerfile
target: development
image: ${PREFIX}-app
restart: unless-stopped
env_file: .env
depends_on:
- db
- solr
- redis
ports:
- '3000:3000'
volumes:
- .:/code
- bundle-cache:/usr/local/bundle
- node_modules:/code/node_modules
environment:
RAILS_ENV: development
RAILS_LOG_TO_STDOUT: 'true'
db:
container_name: ${PREFIX}-db
logging:
driver: none
image: postgres:14.2
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
volumes:
- solr-data:/var/solr
- ./solr:/opt/solr/server/solr/configsets/development
command:
- solr-precreate
- tess
- /opt/solr/server/solr/configsets/development
ports:
- '8984:8983'
redis:
container_name: ${PREFIX}-redis
image: redis:6
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: development
image: ${PREFIX}-app
depends_on:
- app
- db
- redis
volumes:
- .:/code
- bundle-cache:/usr/local/bundle
env_file: .env
environment:
RAILS_ENV: development
command: bundle exec sidekiq
test:
profiles:
- test
depends_on:
- test-db
- redis
container_name: ${PREFIX}-test
build:
context: .
dockerfile: Dockerfile
image: ${PREFIX}-app
volumes:
- .:/code
- bundle-cache:/usr/local/bundle
- node_modules:/code/node_modules
environment:
RAILS_ENV: test
DB_HOST: test-db
DB_NAME: tess-test
DB_USER: tess-test
DB_PASSWORD: tess-test
REDIS_TEST_URL: redis://redis:6379/0
command: sh -c "rake db:test:prepare && rails test"
test-db:
profiles:
- test
container_name: ${PREFIX}-test-db
logging:
driver: none
image: postgres:14.2
environment:
PGDATA: /var/lib/postgresql/data
POSTGRES_DB: tess-test
POSTGRES_USER: tess-test
POSTGRES_PASSWORD: tess-test
volumes:
- test-db-data:/var/lib/postgresql/data
volumes:
db-data:
solr-data:
redis-data:
bundle-cache:
node_modules:
test-db-data: