Make JVM aware of docker container memory limits
@@ -9,5 +9,9 @@ ADD . /ache-src
WORKDIR /ache-src
RUN /ache-src/gradlew installDist && mv /ache-src/build/install/ache /ache && rm -rf /ache-src/ /root/.gradle
+# Makes JVM aware of memory limit available to the container (cgroups)
+ENV JAVA_OPTS='-XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap'
+
ENTRYPOINT ["/ache/bin/ache"]
+
VOLUME ["/data", "/config"]
