-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
22 lines (19 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
# Allows you to run this app easily as a docker container.
# See README.md for more details.
#
# 1. Build the image with: docker build --no-cache -t test/start-templates:latest .
# 2. Run the image with: docker run --rm -ti -p8080:8080 test/start-templates
#
# Uses Docker Multi-stage builds: https://docs.docker.com/build/building/multi-stage/
# The "Build" stage. Copies the entire project into the container, into the /app/ folder, and builds it.
FROM eclipse-temurin:17 AS BUILD
COPY . /app/
WORKDIR /app/
RUN ./mvnw clean test package -Pproduction
# At this point, we have the app (executable jar file): /app/target/starttemplates-1.0-SNAPSHOT.jar
# The "Run" stage. Start with a clean image, and copy over just the app itself, omitting gradle, npm and any intermediate build files.
FROM eclipse-temurin:17
COPY --from=BUILD /app/target/starttemplates-1.0-SNAPSHOT.jar /app/
WORKDIR /app/
EXPOSE 8080
ENTRYPOINT java -jar starttemplates-1.0-SNAPSHOT.jar 8080