-
Notifications
You must be signed in to change notification settings - Fork 38
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
182 lines (171 loc) · 5.44 KB
/
Copy pathdocker-compose.yml
File metadata and controls
182 lines (171 loc) · 5.44 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
services:
postgres:
# When you update PostgreSQL, make sure to upgrade the `postgresql-client` version
# in `Dockerfile` and `Dockerfile.development`. This ensures that `pg_dump` and
# `psql` versions stay in sync with the PostgreSQL version, reducing the risk of
# incompatibilities.
image: "citizenlabdotco/postgis-pgvector:latest"
# From https://www.postgresql.org/docs/current/non-durability.html
command: postgres -c fsync=off -c synchronous_commit=off -c full_page_writes=off
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
ports:
- "5432:5432"
volumes:
- "postgres:/var/lib/postgresql/data"
# NOTE: WORKTREE_PREFIX is an env var that can be set when running in a git worktree
# to allow independent containers per worktree (though they cannot run simultaneously due to port conflicts)
web:
container_name: ${WORKTREE_PREFIX:-cl}-back-web
depends_on:
- "postgres"
- "mailcatcher"
- "rabbitmq"
# - 'memcached'
build:
context: .
dockerfile: back/Dockerfile.development
args:
USER_UID: ${USER_UID:-1000}
USER_GID: ${USER_GID:-1000}
user: "${USER_UID:-1000}:${USER_GID:-1000}"
ports:
- "4000:4000"
volumes:
- "./back:/citizenlab/back"
- bundle:/bundle
env_file:
- "env_files/back-safe.env"
- "env_files/back-secret.env"
environment:
- BUNDLE_PATH=/bundle
- BASE_DEV_URI
- USER_UID=${USER_UID:-1000}
- USER_GID=${USER_GID:-1000}
- ASSET_HOST_URI
tty: true
stdin_open: true
que:
container_name: ${WORKTREE_PREFIX:-cl}-que
depends_on:
- "postgres"
- "mailcatcher"
- "rabbitmq"
build:
context: .
dockerfile: back/Dockerfile.development
args:
USER_UID: ${USER_UID:-1000}
USER_GID: ${USER_GID:-1000}
user: "${USER_UID:-1000}:${USER_GID:-1000}"
command: bundle exec que
volumes:
- "./back:/citizenlab/back"
- bundle:/bundle
env_file:
- "env_files/back-safe.env"
- "env_files/back-secret.env"
environment:
- BUNDLE_PATH=/bundle
- USER_UID=${USER_UID:-1000}
- USER_GID=${USER_GID:-1000}
tty: true
stdin_open: true
rabbitmq:
container_name: ${WORKTREE_PREFIX:-cl}-back-rabbit
image: "rabbitmq:3.8-management"
ports:
- "8088:15672"
volumes:
- "./back/rabbitmq_enabled_plugins:/etc/rabbitmq/enabled_plugins"
mailcatcher:
image: "schickling/mailcatcher"
ports:
- "1080:1080"
# Include this and uncomment :mem_cache_store in
# `config/environments/development.rb` if you want to enable caching in
# development
# memcached:
# image: memcached:alpine
# command: memcached -m 64
# Open API documentation - Only starts if you run docker compose --profile openapi up
openapi:
container_name: ${WORKTREE_PREFIX:-cl}-open-api
image: swaggerapi/swagger-ui
ports:
- 8080:8080
volumes:
- ./back/doc/public_api:/usr/share/nginx/html/doc
environment:
URLS: "[{ url: 'doc/open_api.json', name: 'Public API'}]"
profiles:
- openapi
# For generating PDFs
gotenberg:
container_name: ${WORKTREE_PREFIX:-cl}-gotenberg
image: gotenberg/gotenberg:8.21
restart: always
# Fake OIDC provider used by the `fake_sso` verification/auth method.
# Only starts if you run `docker compose --profile fake_sso up`
# (or via `make up-fake-sso` / `make e2e-setup-and-up-fake-sso`).
#
# Local setup (one-time):
# 1) Clone the fake_sso repo next to the citizenlab repo (defaults to ../fake_sso)
# or set FAKE_SSO_PATH to wherever you have it checked out.
# 2) Add `127.0.0.1 host.docker.internal` to /etc/hosts so the browser can
# resolve the OIDC issuer (the back-end already reaches it via the docker
# host-gateway).
fake_sso:
# Distinct from the standalone fake_sso/docker-compose.yml (which uses
# `cl-fake-sso`) so the two stacks can coexist without conflicting.
container_name: ${WORKTREE_PREFIX:-cl}-fake-sso-app
image: node:22-alpine
working_dir: /app
ports:
- "8081:8081"
volumes:
- "${FAKE_SSO_PATH:-../fake_sso}:/app"
# Anonymous volume so the in-container install doesn't trash the host's
# node_modules (the host may have darwin-built native modules).
- "/app/node_modules"
command: sh -c "npm install --no-audit --no-fund --prefer-offline && npm start"
env_file:
# Pulls FAKE_SSO_JWT_SECRET from the main back env so the id_token can be
# verified by the Rails back-end.
- "env_files/back-secret.env"
environment:
PORT: 8081
profiles:
- fake_sso
# Front-end dev server - Only starts if you run docker compose --profile frontend up
front:
container_name: ${WORKTREE_PREFIX:-cl}-front
image: node:24.15.0
working_dir: /citizenlab/front
command: sh -c "npm install && npm start"
depends_on:
- "web"
ports:
- "3000:3000"
volumes:
- "./front:/citizenlab/front"
- front_node_modules:/citizenlab/front/node_modules
env_file:
- "env_files/front-safe.env"
- "env_files/front-secret.env"
environment:
- API_HOST=web
- API_PORT=4000
- NODE_OPTIONS=--max-old-space-size=4096
tty: true
stdin_open: true
profiles:
- frontend
volumes:
postgres:
bundle:
front_node_modules:
networks:
default:
name: ${WORKTREE_PREFIX:-citizenlab}