-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add dockerfile and embed git hash into properties file
- Loading branch information
1 parent
640a30e
commit 8ccdaa9
Showing
3 changed files
with
64 additions
and
5 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,27 @@ | ||
ARG APP_DIR=/opt/wylx | ||
ARG BUILD_DIR=/tmp/wylx | ||
ARG GIT_COMMIT="Unknown" | ||
|
||
# Build Container | ||
FROM gradle:jdk17-alpine AS BUILD | ||
|
||
ARG BUILD_DIR | ||
ARG GIT_COMMIT | ||
ENV GIT_COMMIT=$GIT_COMMIT | ||
WORKDIR $BUILD_DIR | ||
COPY --chown=gradle:gradle build.gradle settings.gradle $BUILD_DIR/ | ||
COPY --chown=gradle:gradle src $BUILD_DIR/src | ||
|
||
RUN gradle build --no-daemon | ||
|
||
RUN unzip $BUILD_DIR/build/distributions/WylxBot.zip -d $BUILD_DIR/unzip | ||
|
||
# Final Application Container | ||
FROM eclipse-temurin:17-jre-alpine | ||
ARG BUILD_DIR | ||
ARG APP_DIR | ||
WORKDIR $APP_DIR | ||
|
||
COPY --from=BUILD $BUILD_DIR/unzip $APP_DIR/ | ||
|
||
ENTRYPOINT ./WylxBot/bin/WylxBot |
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