-
-
Notifications
You must be signed in to change notification settings - Fork 175
Expand file tree
/
Copy pathdocker-compose-native.yml
More file actions
48 lines (46 loc) · 1.82 KB
/
docker-compose-native.yml
File metadata and controls
48 lines (46 loc) · 1.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
# RESTHeart Native Docker Compose Configuration
# Runs RESTHeart native image with MongoDB in replica set mode
# The native image is built using GraalVM Native Image technology, that produces a standalone binary executable
name: restheart-native
services:
# RESTHeart API server (GraalVM native image)
restheart:
image: softinstigate/restheart:latest-native
environment:
# RHO (RESTHeart Overrides) - Override default configuration
# Uses semicolon-separated XPath expressions to modify config
# Note: Arrays use XPath 1.0 indexing (1-based, not 0-based)
# Uncomment the commented line below to override the default mount and expose all databases at root
RHO: >
/core/name->"native";
/mclient/connection-string->"mongodb://mongodb";
/http-listener/host->"0.0.0.0";
# /mongo/mongo-mounts[1]->{"what":"*","where":"/"};
# Wait for MongoDB to be healthy before starting
depends_on:
mongodb:
condition: service_healthy
# You can add JavaScript plugins by mounting the plugins directory
# volumes:
# - ./plugins:/opt/restheart/plugins
ports:
- "8080:8080" # Expose RESTHeart API on http://localhost:8080
# MongoDB database server
mongodb:
image: mongo:8.0
# Run as replica set (required for change streams and transactions)
command: ["--bind_ip_all", "--replSet", "rs0"]
# Health check to initialize replica set
healthcheck:
test:
[
"CMD",
"mongosh",
"--quiet",
"--eval",
"'if (!rs.isMaster().ismaster) { rs.initiate(); }'",
]
interval: 5s # Check every 5 seconds
timeout: 10s # Wait up to 10 seconds for response
retries: 5 # Retry 5 times before marking unhealthy
start_period: 5s # Grace period before health checks start