Repository navigation
Expand file tree
/
Copy pathDockerfile
More file actions
44 lines (38 loc) · 1.98 KB
/
Copy pathDockerfile
File metadata and controls
44 lines (38 loc) · 1.98 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
ARG GRAALVM_VERSION=25.1.3-graalce
FROM softinstigate/graalvm:${GRAALVM_VERSION}
LABEL org.opencontainers.image.title="RESTHeart"
LABEL org.opencontainers.image.description="RESTHeart is The Backend Framework with MongoDB Data APIs. "
LABEL org.opencontainers.image.url="https://restheart.org"
LABEL org.opencontainers.image.licenses="AGPL-3.0, Apache-2.0"
LABEL org.opencontainers.image.authors="SoftInstigate <info@softinstigate.com>"
LABEL org.opencontainers.image.vendor="SoftInstigate"
LABEL org.opencontainers.image.source="https://github.com/SoftInstigate/restheart"
LABEL org.opencontainers.image.documentation="https://restheart.org/docs"
LABEL maintainer="SoftInstigate <info@softinstigate.com>"
WORKDIR /opt/restheart
# Copy the executable jar and the required libraries
COPY target/restheart.jar ./restheart.jar
COPY target/lib/*.jar lib/
COPY target/plugins/*.jar plugins/
COPY target/plugins/lib/*.jar plugins/lib/
# set environment variables
ENV RHO='/mclient/connection-string->"mongodb://host.docker.internal";/http-listener/host->"0.0.0.0"'
# JDK 25 optimized for RESTHeart: low-latency REST API, 1-2 vCPU, 1-2GB container RAM
# Default G1 GC is the best fit: MongoDB is the bottleneck, not the JVM.
# ZGC would add CPU and memory overhead with no benefit when virtual threads
# are mostly parked on I/O. G1 pause times are short enough at 1-2GB heaps.
# NOTE: Graal JIT is enabled by default to support GraalVM polyglot plugin capabilities.
# If you are not using polyglot plugins, adding -XX:-UseJVMCICompiler will reduce
# compiler memory overhead significantly in constrained containers (recommended for <512Mi heap).
ENTRYPOINT [ "java", \
"-Dfile.encoding=UTF-8", \
"--enable-native-access=ALL-UNNAMED", \
"--sun-misc-unsafe-memory-access=allow", \
"-XX:MaxRAMPercentage=70.0", \
"-XX:InitialRAMPercentage=60.0", \
"-XX:+DisableExplicitGC", \
"-XX:+ExitOnOutOfMemoryError", \
"-XX:+UseCompactObjectHeaders", \
"-jar", \
"restheart.jar" ]
EXPOSE 8009 8080 4443