-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
246 lines (234 loc) · 7.68 KB
/
docker-compose.yml
File metadata and controls
246 lines (234 loc) · 7.68 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
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
name: payload-monorepo
# Unified Docker Compose for all Payload test services
#
# Usage:
# pnpm docker:start - Clean + start ALL services with fresh data
# pnpm docker:clean - Force-remove containers, volumes, and orphans
#
# Profiles (used by CI to start individual services):
# --profile all - Everything
# --profile postgres - PostgreSQL only
# --profile mongodb - MongoDB + mongot only
# --profile mongodb-atlas - MongoDB Atlas Local only
# --profile storage - LocalStack (S3), Azure Storage, fake GCS
services:
# ── PostgreSQL (PostGIS + pgvector) ──────────────────────────
# Connection: postgres://payload:payload@localhost:5433/payload
postgres:
profiles: [all, postgres]
image: ghcr.io/payloadcms/postgis-vector:latest
container_name: postgres-payload-test
ports:
- '5433:5432'
environment:
POSTGRES_USER: payload
POSTGRES_PASSWORD: payload
POSTGRES_DB: payload
command:
- postgres
- -c
- wal_level=replica
- -c
- max_wal_senders=5
- -c
- max_replication_slots=5
- -c
- hot_standby=on
volumes:
- postgres_data:/var/lib/postgresql/data
- ./__helpers/shared/db/postgres/primary-init.sh:/docker-entrypoint-initdb.d/10-replication.sh:ro
healthcheck:
test: ['CMD-SHELL', 'pg_isready -U payload -d payload']
interval: 1s
timeout: 5s
retries: 30
start_period: 2s
restart: unless-stopped
# ── PostgreSQL Read Replica (streaming replica of postgres) ───
# Connection: postgres://payload:payload@localhost:5434/payload
postgres-replica:
profiles: [all, postgres]
image: ghcr.io/payloadcms/postgis-vector:latest
container_name: postgres-replica-payload-test
depends_on:
postgres:
condition: service_healthy
ports:
- '5434:5432'
environment:
POSTGRES_USER: payload
POSTGRES_PASSWORD: payload
POSTGRES_DB: payload
PRIMARY_HOST: postgres
PRIMARY_PORT: '5432'
PRIMARY_USER: payload
PRIMARY_PASSWORD: payload
volumes:
- postgres_replica_data:/var/lib/postgresql/data
- ./__helpers/shared/db/postgres/replica-entrypoint.sh:/replica-entrypoint.sh:ro
entrypoint: ['/bin/bash', '/replica-entrypoint.sh']
healthcheck:
test: ['CMD-SHELL', 'pg_isready -U payload -d payload']
interval: 2s
timeout: 5s
retries: 60
start_period: 30s
restart: unless-stopped
# ── MongoDB Community 8.2 (replica set + search) ────────────
# Connection: mongodb://payload:payload@localhost:27018/payload?authSource=admin&directConnection=true&replicaSet=rs0
mongodb:
profiles: [all, mongodb]
image: mongodb/mongodb-community-server:8.2-ubi9
container_name: mongodb-payload-test
ports:
- '27018:27017'
volumes:
- mongodb_data:/data/db
- mongodb_configdb:/data/configdb
- ./__helpers/shared/db/mongodb/keyfile:/etc/mongodb/keyfile:ro
- ./__helpers/shared/db/mongodb/docker-compose-entrypoint.sh:/docker-compose-entrypoint.sh:ro
entrypoint: ['/bin/bash', '/docker-compose-entrypoint.sh']
healthcheck:
test:
[
'CMD',
'mongosh',
'-u',
'admin',
'-p',
'adminPassword',
'--authenticationDatabase',
'admin',
'--eval',
"db.adminCommand('ping')",
]
interval: 2s
timeout: 5s
retries: 30
start_period: 5s
restart: unless-stopped
# mongot - MongoDB Community Search for $search and $vectorSearch
mongot:
profiles: [all, mongodb]
image: mongodb/mongodb-community-search:latest
container_name: mongot-payload-test
depends_on:
mongodb:
condition: service_healthy
volumes:
- mongot_data:/var/lib/mongot
- ./__helpers/shared/db/mongodb/mongot-config.yml:/etc/mongot/config-readonly.yml:ro
- ./__helpers/shared/db/mongodb/passwordFile:/etc/mongot/secrets/passwordFile-readonly:ro
entrypoint: ['/bin/sh', '-c']
command:
- |
cp /etc/mongot/config-readonly.yml /var/lib/mongot/config.yml
cp /etc/mongot/secrets/passwordFile-readonly /var/lib/mongot/passwordFile
chmod 400 /var/lib/mongot/passwordFile
sed -i 's|/etc/mongot/secrets/passwordFile|/var/lib/mongot/passwordFile|g' /var/lib/mongot/config.yml
/mongot-community/mongot --config /var/lib/mongot/config.yml
healthcheck:
test: ['CMD-SHELL', 'curl -sf http://localhost:8080/health || exit 1']
interval: 2s
timeout: 5s
retries: 60
start_period: 5s
restart: unless-stopped
# ── MongoDB Atlas Local (all-in-one with Atlas Search) ──────
# Connection: mongodb://localhost:27019/payload?directConnection=true&replicaSet=mongodb-atlas-local
mongodb-atlas:
profiles: [all, mongodb-atlas]
image: mongodb/mongodb-atlas-local:latest
container_name: mongodb-atlas-payload-test
hostname: mongodb-atlas-local
ports:
- '27019:27017'
volumes:
- mongodb_atlas_data:/data/db
- mongodb_atlas_configdb:/data/configdb
environment:
- MONGODB_INITDB_ROOT_USERNAME=
- MONGODB_INITDB_ROOT_PASSWORD=
healthcheck:
test: ['CMD', 'mongosh', '--eval', "db.adminCommand('ping')"]
interval: 2s
timeout: 5s
retries: 30
start_period: 5s
restart: unless-stopped
# ── LocalStack (S3 emulator) ────────────────────────────────
localstack:
profiles: [all, storage]
image: localstack/localstack:4.14.0
container_name: localstack_demo
ports:
- '4563-4599:4563-4599'
- '8055:8080'
environment:
- SERVICES=s3
- DEBUG=1
- DATA_DIR=/tmp/localstack/data
volumes:
- localstack_data:/var/lib/localstack
- '/var/run/docker.sock:/var/run/docker.sock'
- './localstack-init/ready.d:/etc/localstack/init/ready.d'
# ── Azure Storage (Azurite emulator) ────────────────────────
azure-storage:
profiles: [all, storage]
image: mcr.microsoft.com/azure-storage/azurite:latest
platform: linux/amd64
restart: always
command: 'azurite --loose --blobHost 0.0.0.0 --tableHost 0.0.0.0 --queueHost 0.0.0.0 --skipApiVersionCheck'
ports:
- '10000:10000'
- '10001:10001'
- '10002:10002'
volumes:
- azurestoragedata:/data
# ── Google Cloud Storage (fake-gcs-server) ──────────────────
google-cloud-storage:
profiles: [all, storage]
image: fsouza/fake-gcs-server
restart: always
command:
[
'-scheme',
'http',
'-port',
'4443',
'-public-host',
'http://localhost:4443',
'-external-url',
'http://localhost:4443',
'-backend',
'memory',
]
ports:
- '4443:4443'
volumes:
- google_cloud_storage_data:/data
# ── Vercel Blob (vercel-blob-emulator) ──────────────────────
vercel-blob:
profiles: [all, storage]
image: ghcr.io/payloadcms/vercel-blob-emulator:latest
container_name: vercel-blob-payload-test
restart: always
ports:
- '3100:3000'
environment:
BLOB_STORE_ID: emulator
EMULATOR_BASE_URL: 'http://localhost:3100'
volumes:
- vercel_blob_data:/data
volumes:
postgres_data:
postgres_replica_data:
mongodb_data:
mongodb_configdb:
mongot_data:
mongodb_atlas_data:
mongodb_atlas_configdb:
localstack_data:
azurestoragedata:
google_cloud_storage_data:
vercel_blob_data: