Repository navigation
Expand file tree
/
Copy pathdocker-compose.documentdb.yml
More file actions
52 lines (49 loc) · 1.97 KB
/
Copy pathdocker-compose.documentdb.yml
File metadata and controls
52 lines (49 loc) · 1.97 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
# DocumentDB (https://github.com/documentdb/documentdb) instead of MongoDB:
#
# DOCUMENTDB_PASSWORD=<a password> docker compose -f docker-compose.yml -f docker-compose.documentdb.yml up
#
# DocumentDB is MongoDB-compatible and stores the data in PostgreSQL. This uses
# its all-in-one local image (PostgreSQL + extensions + gateway): fine for
# development and small installs. For production see docs/deployment/documentdb.md.
# The API connects over TLS, to the self-signed certificate the gateway makes at
# first start, hence tlsAllowInvalidCertificates here. Anywhere else use a real CA
# (DB_SSL_MODE + DB_CA_CERT, or tlsCAFile in DB_URI) and --tlsMode requireTLS.
# (The local image also accepts plain connections by default.)
services:
db:
# MongoDB is not needed with DocumentDB
scale: 0
documentdb:
image: ghcr.io/documentdb/documentdb/documentdb-local:latest
container_name: documentdb
restart: always
command:
- --username
- ${DOCUMENTDB_USERNAME:-ever}
- --password
- ${DOCUMENTDB_PASSWORD:?set DOCUMENTDB_PASSWORD}
environment:
# the local image reports anonymous usage by default
DOCUMENTDB_USAGE_TELEMETRY: 'false'
volumes:
- documentdb_data:/data
ports:
- '10260:10260'
networks:
- overlay
api:
environment:
WAIT_HOSTS: documentdb:10260
DB_HOST: documentdb
DB_PORT: 10260
# credentials as options, not in the URI, so any password works unencoded
DB_URI: mongodb://documentdb:10260/ever_development?tls=true&tlsAllowInvalidCertificates=true
DB_USER: ${DOCUMENTDB_USERNAME:-ever}
DB_PASS: ${DOCUMENTDB_PASSWORD:?set DOCUMENTDB_PASSWORD}
DB_NAME: ever_development
depends_on: !override
- documentdb
links: !override
- documentdb
volumes:
documentdb_data: