-
Notifications
You must be signed in to change notification settings - Fork 307
/
Dockerfile
34 lines (24 loc) · 853 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
#########################################################
# First stage: image to build the application #
#########################################################
FROM adoptopenjdk/openjdk11-openj9:alpine-slim as builder
WORKDIR /builder
# Copy Gradle file
COPY *.gradle /builder/
# Copy sources
COPY src /builder/src
# Copy Gradle resources
COPY gradle /builder/gradle
COPY gradlew /builder/gradlew
# Test project
RUN ./gradlew test
# Build project
RUN ./gradlew assemble
#########################################################
# Second stage: image to run the application #
#########################################################
FROM jetty:9.4-jre11-slim
# Pull the built files from the builder container
COPY --from=builder /builder/build/libs/*.war /var/lib/jetty/webapps/wahlzeit.war
# Expose port
EXPOSE 8080