-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
23 lines (22 loc) · 862 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
FROM openjdk:16-jdk as builder
WORKDIR /etc/todo-reminder
COPY . .
USER root
# Create the shadowjar (chmod +x makes the gradlew script executable)
RUN chmod +x ./gradlew
RUN ./gradlew shadowJar
FROM openjdk:16-jdk
WORKDIR /opt/todo-reminder
# Copy the shadowjar in the current workdir
COPY --from=builder ./etc/todo-reminder/build/libs/ .
# Copy the .env file too
# SHOULD BE REMOVED IF IMAGE GETS PUBLISHED
COPY --from=builder ./etc/todo-reminder/.env .
# Entrypoint is used instead of CMD because the image is not intended to run another executable instead of the jar
ENTRYPOINT java \
# Sets the java heap size (taken from .env file which is passed in the docker-compose.yml file)
-Xmx${RAM_LIMIT} \
# java -D tag --> set a system property
-Dkotlin.script.classpath="/opt/todo-reminder/todo-reminder.jar" \
-jar \
./todo-reminder.jar