-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #213 from entur/dockerfile-build
Dockerfile build
- Loading branch information
Showing
5 changed files
with
109 additions
and
17 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
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,36 @@ | ||
/.git | ||
|
||
/target | ||
# !**/src/main/**/target/ | ||
# !**/src/test/**/target/ | ||
|
||
### STS ### | ||
.apt_generated | ||
.classpath | ||
.factorypath | ||
.project | ||
.settings | ||
.springBeans | ||
.sts4-cache | ||
|
||
### IntelliJ IDEA ### | ||
.idea | ||
*.iws | ||
*.iml | ||
*.ipr | ||
|
||
### NetBeans ### | ||
/nbproject/private/ | ||
/nbbuild/ | ||
/dist/ | ||
/nbdist/ | ||
/.nb-gradle/ | ||
build/ | ||
!**/src/main/**/build/ | ||
!**/src/test/**/build/ | ||
|
||
### VS Code ### | ||
.vscode/ | ||
|
||
### terraform ### | ||
.terraform/ |
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,38 @@ | ||
FROM eclipse-temurin:17.0.8_7-jdk-alpine as builder | ||
|
||
# Cache-mount /root/.m2 to speed up subsequent builds. | ||
# Bind-mount pom.xml, .mvn & mvnw to avoid having to copy it. | ||
RUN --mount=type=bind,source=pom.xml,target=pom.xml \ | ||
--mount=type=bind,source=.mvn,target=.mvn \ | ||
--mount=type=bind,source=mvnw,target=mvnw \ | ||
--mount=type=cache,target=/root/.m2/ \ | ||
./mvnw dependency:copy-dependencies | ||
|
||
COPY . ./ | ||
|
||
# Cache-mount /root/.m2 to speed up subsequent builds. | ||
# Bind-mount pom.xml, .mvn & mvnw to avoid having to copy it. | ||
RUN --mount=type=bind,source=pom.xml,target=pom.xml \ | ||
--mount=type=bind,source=.mvn,target=.mvn \ | ||
--mount=type=bind,source=mvnw,target=mvnw \ | ||
--mount=type=cache,target=/root/.m2/ \ | ||
env CI=true \ | ||
./mvnw install -DskipTests -P prettierSkip | ||
|
||
FROM eclipse-temurin:17.0.8_7-jdk-alpine | ||
|
||
RUN apk update && apk upgrade && apk add --no-cache \ | ||
tini | ||
|
||
RUN addgroup appuser && adduser --disabled-password appuser --ingroup appuser | ||
USER appuser | ||
|
||
WORKDIR /home/appuser | ||
|
||
RUN chown -R appuser:appuser /home/appuser | ||
USER appuser | ||
|
||
# todo: don't hard-code lamassu's version here | ||
COPY --from=builder target/lamassu-0.0.1-SNAPSHOT.jar lamassu.jar | ||
|
||
CMD [ "/sbin/tini", "--", "java", "-jar", "lamassu.jar" ] |
This file was deleted.
Oops, something went wrong.
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