generated from BCDevOps/opendev-template
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
185 lines (172 loc) · 4.82 KB
/
docker-compose.yml
File metadata and controls
185 lines (172 loc) · 4.82 KB
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
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
# NOTE: this is a minimal setup to get going in LOCAL development only, this is not intended for production use (the project is hoste on Openshift, see devops folder for helm charts)
# Dummy shared ENV vars
x-env-vars: &default-env-vars
BROWSER: "true" # so that launchy does not error out - @TODO: figure out local emails in docker compose environment
RAILS_ENV: development
REDIS_URL: redis://redis:6379/0
ANYCABLE_REDIS_URL: redis://redis:6379/1
ANYCABLE_URL: ws://localhost:8080/cable
RATE_LIMIT_DEV_REDIS_URL: redis://redis:6379/2
SIMPLE_FEED_DEV_REDIS_URL: redis://redis:6379/3
CACHE_DEV_REDIS_URL: redis://redis:6379/4
DEVISE_JWT_SECRET_KEY: supersecret
DATABASE_URL: postgres://postgres:password@postgres:5432/app_development
CLAMAV_ENABLED: "true"
ELASTICSEARCH_URL: http://elasticsearch:9200
services:
app:
image: hous-permit-portal-dev:latest
pull_policy: 'never'
tty: true
stdin_open: true
build:
context: .
dockerfile: ./devops/docker/app/Dockerfile.dev
env_file: .env.docker_compose
volumes:
- .:/app
- /app/node_modules
- virus_scan_tmp:/tmp/virus_scan
ports:
- '3000:3000'
depends_on:
- postgres
- redis
- elasticsearch
- vite
environment:
VITE_RUBY_HOST: vite
IS_APP_SERVER: "true"
CLAMAV_HOST: "clamav"
CLAMAV_PORT: "3310"
CLAMAV_TIMEOUT: "30"
VIRUS_SCAN_TEMP_DIR: "/tmp/virus_scan"
<<: *default-env-vars
command: >
bash -c "bundle exec rails s -b '0.0.0.0' -p 3000"
vite:
image: hous-permit-portal-dev:latest
pull_policy: 'never'
working_dir: /app
env_file: .env.docker_compose
volumes:
- .:/app
- /app/node_modules
environment:
<<: *default-env-vars
VITE_RUBY_HOST: '0.0.0.0'
command: './bin/vite dev'
ports:
- '3036:3036'
sidekiq:
image: hous-permit-portal-dev:latest
pull_policy: 'never'
tty: true
stdin_open: true
working_dir: /app
env_file: .env.docker_compose
volumes:
- .:/app
- virus_scan_tmp:/tmp/virus_scan
environment:
CLAMAV_HOST: "clamav"
CLAMAV_PORT: "3310"
CLAMAV_TIMEOUT: "30"
VIRUS_SCAN_TEMP_DIR: "/tmp/virus_scan"
<<: *default-env-vars
command: 'bundle exec sidekiq'
depends_on:
- app
anycable-rpc:
image: hous-permit-portal-dev:latest
pull_policy: 'never'
command: bundle exec anycable
volumes:
- .:/app
environment:
<<: *default-env-vars # need to inject DEVISE_JWT_SECRET_KEY and DATABASE_URL here might as well just reference the block
ANYCABLE_REDIS_URL: redis://redis:6379/1
ANYCABLE_RPC_HOST: '0.0.0.0:50051'
ANYCABLE_LOG_LEVEL: debug
ports:
- '50051:50051'
depends_on:
- redis
- app
anycable-go:
image: anycable/anycable-go:1.4.8
environment:
ANYCABLE_HOST: '0.0.0.0'
ANYCABLE_PORT: '8080'
ANYCABLE_RPC_HOST: anycable-rpc:50051
ANYCABLE_REDIS_URL: redis://redis:6379/1
ANYCABLE_LOG_LEVEL: debug
ports:
- '8080:8080'
depends_on:
- redis
- app
postgres:
image: postgres:16
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: password
ports:
- '5432:5432'
volumes:
- postgres_data:/var/lib/postgresql/data
redis:
image: redis:7
volumes:
- redis_data:/data
elasticsearch:
image: bitnamilegacy/elasticsearch:9.1.2-debian-12-r0
environment:
- discovery.type=single-node
- xpack.security.enabled=false
- xpack.security.transport.ssl.enabled=false
- xpack.security.http.ssl.enabled=false
- cluster.routing.allocation.disk.threshold_enabled=false
- "ES_JAVA_OPTS=-Xms512m -Xmx512m" # Limit heap to 512MB for development
ports:
- '9200:9200'
volumes:
- elasticsearch_data:/usr/share/elasticsearch/data
# MinIO for local S3-compatible storage (commented out for AWS S3 usage)
# minio:
# image: minio/minio:latest
# environment:
# MINIO_ROOT_USER: minioadmin
# MINIO_ROOT_PASSWORD: minioadmin123
# ports:
# - '9000:9000'
# - '9001:9001'
# volumes:
# - minio_data:/data
# command: server /data --console-address ":9001"
# healthcheck:
# test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"]
# interval: 30s
# timeout: 20s
# retries: 3
# ClamAV for virus scanning
clamav:
build: ./devops/docker/clamav
ports:
- '3310:3310'
volumes:
- clamav_db:/var/lib/clamav
- virus_scan_tmp:/tmp/virus_scan
healthcheck:
test: ['CMD', '/usr/local/bin/health-check.sh']
interval: 30s
timeout: 10s
retries: 3
restart: unless-stopped
volumes:
postgres_data:
redis_data:
elasticsearch_data:
# minio_data:
virus_scan_tmp:
clamav_db: