-
Notifications
You must be signed in to change notification settings - Fork 5
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
24 additions
and
8 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 |
---|---|---|
@@ -1,9 +1,25 @@ | ||
FROM alpine:latest | ||
LABEL version=5.9.2 description="EPAM Report portal. Service jobs" maintainer="Andrei Varabyeu <[email protected]>, Hleb Kanonik <[email protected]>" | ||
ARG GH_TOKEN | ||
RUN echo 'exec java ${JAVA_OPTS} -jar service-jobs-5.9.2-exec.jar' > /start.sh && chmod +x /start.sh && \ | ||
wget --header="Authorization: Bearer ${GH_TOKEN}" -q https://maven.pkg.github.com/reportportal/service-jobs/com/epam/reportportal/service-jobs/5.9.2/service-jobs-5.9.2-exec.jar | ||
ENV JAVA_OPTS="-Xmx512m -XX:+UseG1GC -XX:InitiatingHeapOccupancyPercent=70 -Djava.security.egd=file:/dev/./urandom" | ||
FROM gradle:6.8.3-jdk11 AS build | ||
ARG BOM_VERSION MIGRATION_VERSION GITHUB_USER GITHUB_TOKEN RELEASE_MODE SCRIPTS_VERSION APP_VERSION | ||
WORKDIR /usr/app | ||
COPY . /usr/app | ||
RUN if [ ${RELEASE_MODE} = true ]; then \ | ||
gradle build --exclude-task test \ | ||
-PreleaseMode=true \ | ||
-PgithubUserName=${GITHUB_USER} \ | ||
-PgithubToken=${GITHUB_TOKEN} \ | ||
-Pscripts.version=${SCRIPTS_VERSION} \ | ||
-Pmigrations.version=${MIGRATION_VERSION} \ | ||
-Pbom.version=${BOM_VERSION} \ | ||
-Dorg.gradle.project.version=${APP_VERSION}; \ | ||
else gradle build --exclude-task test -Dorg.gradle.project.version=${APP_VERSION}; fi | ||
|
||
# For ARM build use flag: `--platform linux/arm64` | ||
FROM --platform=$BUILDPLATFORM amazoncorretto:11.0.19 | ||
LABEL version=${APP_VERSION} description="EPAM Report portal. Main API Service" maintainer="Andrei Varabyeu <[email protected]>, Hleb Kanonik <[email protected]>" | ||
ARG APP_VERSION=${APP_VERSION} | ||
ENV APP_DIR=/usr/app JAVA_OPTS="-Xmx1g -XX:+UseG1GC -XX:InitiatingHeapOccupancyPercent=70 -Djava.security.egd=file:/dev/./urandom" | ||
WORKDIR $APP_DIR | ||
COPY --from=build $APP_DIR/build/libs/service-jobs-*exec.jar . | ||
VOLUME ["/tmp"] | ||
EXPOSE 8080 | ||
ENTRYPOINT ./start.sh | ||
ENTRYPOINT exec java ${JAVA_OPTS} -jar ${APP_DIR}/service-jobs-*exec.jar |
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