-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
25 lines (19 loc) · 1.12 KB
/
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
# We select the base image from. Locally available or from https://hub.docker.com/
FROM openjdk:8-jre-alpine
# We define the user we will use in this instance to prevent using root that even in a container, can be a security risk.
ENV APPLICATION_USER admin
# Then we add the user, create the /app folder and give permissions to our user.
RUN adduser -D -g '' $APPLICATION_USER
RUN mkdir /app
RUN chown -R $APPLICATION_USER /app
# Marks this container to use the specified $APPLICATION_USER
USER $APPLICATION_USER
# We copy the FAT Jar we built into the /app folder and sets that folder as the working directory.
COPY ./server/build/libs/smolurl-0.0.1-all.jar /app/smolurl.jar
RUN mkdir /app/web
COPY ./web/build/ /app/web/build
COPY server/excludeList /app/excludeList
WORKDIR /app
EXPOSE 8000
# We launch java to execute the jar, with good defauls intended for containers.
CMD ["java", "-server", "-XX:+UnlockExperimentalVMOptions", "-XX:+UseCGroupMemoryLimitForHeap", "-XX:InitialRAMFraction=2", "-XX:MinRAMFraction=2", "-XX:MaxRAMFraction=2", "-XX:+UseG1GC", "-XX:MaxGCPauseMillis=100", "-XX:+UseStringDeduplication", "-jar", "smolurl.jar"]