forked from dirkriehle/wahlzeit
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add Dockerfile * Extend DatabaseConnection with method to wait for db * Adjust AbstractMain to check DB connection * Add Wahlzeit app to docker-compose * Adjust Dockefile * Refactor AbstractMain to throw runtime error if db is not abailable. * Extend JavaDoc of DatabaseConnection
- Loading branch information
1 parent
eccde5a
commit 71145ae
Showing
6 changed files
with
95 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters