Created
September 8, 2020 19:53
-
-
Save pavelgordon/a808fd53b2f5c9618c4a928d60ebac18 to your computer and use it in GitHub Desktop.
Docker file for Gradle projects(e.g. Ktor). Requires jar file at build/libs/yourapp.jar directory(= run gradle build command before)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM openjdk:8-jre-alpine | |
ENV APPLICATION_USER ktor | |
RUN adduser -D -g '' $APPLICATION_USER | |
RUN ls -la | |
RUN mkdir /app | |
RUN chown -R $APPLICATION_USER /app | |
USER $APPLICATION_USER | |
RUN ls -la | |
COPY ./build/libs/yourapp.jar /app/yourapp.jar | |
WORKDIR /app | |
CMD ["java", "-server", "-XX:+UnlockExperimentalVMOptions", "-XX:+UseCGroupMemoryLimitForHeap", "-XX:InitialRAMFraction=2", "-XX:MinRAMFraction=2", "-XX:MaxRAMFraction=2", "-XX:+UseG1GC", "-XX:MaxGCPauseMillis=100", "-XX:+UseStringDeduplication", "-jar", "yourapp.jar"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment