-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Fully containerized build #179
Open
ktaletsk
wants to merge
1
commit into
usnistgov:develop
Choose a base branch
from
ktaletsk:feat/Dockerfile-CI
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,30 @@ | ||
|
||
# Stage 0: Build image | ||
FROM maven:3.8.3-jdk-8 | ||
|
||
ARG BACKEND_ROOT="WIPP-backend" | ||
ARG BACKEND_APP="wipp-backend-application" | ||
ARG BACKEND_DATA="wipp-backend-data" | ||
ARG BACKEND_CORE="wipp-backend-core" | ||
ARG BACKEND_ARGO="wipp-backend-argo-workflows" | ||
|
||
COPY pom.xml /usr/local/${BACKEND_ROOT}/pom.xml | ||
COPY ${BACKEND_NAME} /usr/local/${BACKEND_ROOT}/${BACKEND_NAME} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fix typo. This should be |
||
COPY ${BACKEND_DATA} /usr/local/${BACKEND_ROOT}/${BACKEND_DATA} | ||
COPY ${BACKEND_CORE} /usr/local/${BACKEND_ROOT}/${BACKEND_CORE} | ||
COPY ${BACKEND_ARGO} /usr/local/${BACKEND_ROOT}/${BACKEND_ARGO} | ||
COPY deploy/docker/maven-settings.xml /usr/share/maven/conf/settings.xml | ||
WORKDIR /usr/local/${BACKEND_ROOT} | ||
RUN mvn clean package -P prod | ||
|
||
# Stage 1: Runtime image | ||
FROM openjdk:8-jdk-alpine | ||
MAINTAINER National Institute of Standards and Technology | ||
LABEL org.opencontainers.image.authors="National Institute of Standards and Technology" | ||
|
||
EXPOSE 8080 | ||
|
||
ARG BACKEND_NAME="wipp-backend-application" | ||
ARG BACKEND_ROOT="WIPP-backend" | ||
ARG BACKEND_APP="wipp-backend-application" | ||
ARG EXEC_DIR="/opt/wipp" | ||
ARG DATA_DIR="/data/WIPP-plugins" | ||
ARG ARGO_VERSION="v2.3.0" | ||
|
@@ -24,8 +45,8 @@ RUN wget https://github.com/argoproj/argo-workflows/releases/download/${ARGO_VER | |
chmod +x argo-linux-amd64 && \ | ||
mv argo-linux-amd64 /usr/local/bin/argo | ||
|
||
# Copy WIPP backend application exec WAR | ||
COPY ${BACKEND_NAME}/target/${BACKEND_NAME}-*-exec.war ${EXEC_DIR}/wipp-backend.war | ||
# Copy WIPP backend application exec WAR from the previous stage | ||
COPY --from=0 /usr/local/${BACKEND_ROOT}/${BACKEND_APP}/target/${BACKEND_APP}-*-exec.war ${EXEC_DIR}/wipp-backend.war | ||
|
||
# Copy properties and entrypoint script | ||
COPY deploy/docker/application.properties ${EXEC_DIR}/config | ||
|
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 openjdk:8-jdk-alpine | ||
LABEL org.opencontainers.image.authors="National Institute of Standards and Technology" | ||
|
||
EXPOSE 8080 | ||
|
||
ARG BACKEND_NAME="wipp-backend-application" | ||
ARG EXEC_DIR="/opt/wipp" | ||
ARG DATA_DIR="/data/WIPP-plugins" | ||
ARG ARGO_VERSION="v2.3.0" | ||
ARG APM_VERSION="1.9.0" | ||
|
||
COPY deploy/docker/VERSION /VERSION | ||
|
||
# Create exec and data folders | ||
RUN mkdir -p \ | ||
${EXEC_DIR}/config \ | ||
${DATA_DIR} | ||
|
||
# Download Elastic APM Java Agent | ||
RUN wget https://repo1.maven.org/maven2/co/elastic/apm/elastic-apm-agent/${APM_VERSION}/elastic-apm-agent-${APM_VERSION}.jar -O ${EXEC_DIR}/elastic-apm-agent.jar | ||
|
||
# Install Argo CLI executable | ||
RUN wget https://github.com/argoproj/argo-workflows/releases/download/${ARGO_VERSION}/argo-linux-amd64 && \ | ||
chmod +x argo-linux-amd64 && \ | ||
mv argo-linux-amd64 /usr/local/bin/argo | ||
|
||
# Copy WIPP backend application exec WAR | ||
COPY ${BACKEND_NAME}/target/${BACKEND_NAME}-*-exec.war ${EXEC_DIR}/wipp-backend.war | ||
|
||
# Copy properties and entrypoint script | ||
COPY deploy/docker/application.properties ${EXEC_DIR}/config | ||
COPY deploy/docker/entrypoint.sh /usr/local/bin | ||
|
||
# Set working directory | ||
WORKDIR ${EXEC_DIR} | ||
|
||
# Entrypoint | ||
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"] |
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,15 @@ | ||
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 | ||
http://maven.apache.org/xsd/settings-1.0.0.xsd"> | ||
<localRepository/> | ||
<interactiveMode/> | ||
<usePluginRegistry/> | ||
<offline/> | ||
<pluginGroups/> | ||
<servers/> | ||
<mirrors/> | ||
<proxies/> | ||
<profiles/> | ||
<activeProfiles/> | ||
</settings> |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it make sense to define a
WORKDIR
(/opt
for example) instead of copying folders to/usr/local/
?