-
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.
- Loading branch information
Showing
2 changed files
with
27 additions
and
1 deletion.
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
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,26 @@ | ||
# 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/vaadin8-sampler:latest . | ||
# 2. Run the image with: docker run --rm -ti -p8080:8080 -m256m test/vaadin8-sampler | ||
# | ||
# 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:11 AS BUILD | ||
RUN apt update && apt install unzip -y | ||
COPY . /app/ | ||
WORKDIR /app/ | ||
RUN ./mvnw -C clean test package -Pproduction | ||
WORKDIR /app/target/ | ||
RUN ls -la | ||
RUN unzip *.zip -d app/ | ||
# At this point, we have the app (executable bash scrip plus a bunch of jars) in the | ||
# /app/target/app/ folder. | ||
|
||
# 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:11 | ||
COPY --from=BUILD /app/target/app /app/ | ||
WORKDIR /app/ | ||
EXPOSE 8080 | ||
ENTRYPOINT ./bin/app |