-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
35 lines (26 loc) · 968 Bytes
/
Dockerfile
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
# App Building phase --------
FROM openjdk:8 AS build
RUN mkdir /appbuild
COPY . /appbuild
WORKDIR /appbuild
RUN ./gradlew clean build
# End App Building phase --------
# Container setup --------
FROM openjdk:8-jre-alpine
# Creating user
ENV APPLICATION_USER 1033
RUN adduser -D -g '' $APPLICATION_USER
# Giving permissions
RUN mkdir /app
RUN mkdir /app/resources
RUN chown -R $APPLICATION_USER /app
RUN chmod -R 755 /app
# Setting user to use when running the image
USER $APPLICATION_USER
# Copying needed files
COPY --from=build /appbuild/build/libs/KtorEasy*all.jar /app/KtorEasy.jar
COPY --from=build /appbuild/resources/ /app/resources/
WORKDIR /app
# Entrypoint definition
CMD ["sh", "-c", "java -server -XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap -XX:InitialRAMFraction=2 -XX:MinRAMFraction=2 -XX:MaxRAMFraction=2 -XX:+UseG1GC -XX:MaxGCPauseMillis=100 -XX:+UseStringDeduplication -jar KtorEasy.jar"]
# End Container setup --------