-
Notifications
You must be signed in to change notification settings - Fork 16
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
1 parent
db4c42a
commit 7760c16
Showing
12 changed files
with
120 additions
and
63 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
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 |
---|---|---|
@@ -1,54 +1,33 @@ | ||
# TODO https://github.com/sovity/edc-broker-server-extension/issues/425 | ||
USER fixme_and_stop_using_root | ||
|
||
FROM gradle:7-jdk17-alpine AS build | ||
|
||
ARG USERNAME | ||
ARG TOKEN | ||
ARG BUILD_ARGS | ||
ARG TEST_POSTGRES_JDBC_URL | ||
ARG TEST_POSTGRES_JDBC_USER | ||
ARG TEST_POSTGRES_JDBC_PASSWORD | ||
|
||
ENV USERNAME=$USERNAME | ||
ENV TOKEN=$TOKEN | ||
|
||
ENV SKIP_TESTCONTAINERS=true | ||
ENV TEST_POSTGRES_JDBC_URL=$TEST_POSTGRES_JDBC_URL | ||
ENV TEST_POSTGRES_JDBC_USER=$TEST_POSTGRES_JDBC_USER | ||
ENV TEST_POSTGRES_JDBC_PASSWORD=$TEST_POSTGRES_JDBC_PASSWORD | ||
|
||
COPY --chown=gradle:gradle . /home/gradle/project/ | ||
WORKDIR /home/gradle/project/ | ||
RUN --mount=type=cache,target=/home/gradle/.gradle/caches gradle build --no-daemon $BUILD_ARGS | ||
|
||
FROM eclipse-temurin:17-jre-alpine | ||
|
||
# TODO https://github.com/sovity/edc-broker-server-extension/issues/425 | ||
USER fixme_and_stop_using_root | ||
|
||
# Optional JVM arguments, such as memory settings | ||
ARG JVM_ARGS="" | ||
|
||
# Install curl for healthcheck and create an empty properties file as migitation for a core EDC issue | ||
RUN apk add --no-cache curl bash && touch /emtpy-properties-file.properties | ||
# Install curl for healthcheck, bash for entrypoint | ||
RUN apk add --no-cache curl bash | ||
SHELL ["/bin/bash", "-c"] | ||
|
||
WORKDIR /app | ||
# Use a non-root user | ||
RUN adduser -D -H -s /sbin/nologin edc | ||
USER edc:edc | ||
|
||
COPY --from=build /home/gradle/project/connector/build/libs/app.jar /app | ||
COPY ./connector/src/main/resources/logging.properties /app | ||
# Which app.jar to include | ||
ARG CONNECTOR_NAME="sovity-ce" | ||
ARG CONNECTOR_TYPE="extensions" | ||
|
||
# health status is determined by the availability of the /health endpoint | ||
HEALTHCHECK --interval=5s --timeout=5s --retries=10 CMD curl -H "x-api-key: $EDC_API_AUTH_KEY" --fail http://localhost:11001/backend/api/check/health | ||
# For last-commit-info extension | ||
ARG EDC_LAST_COMMIT_INFO_ARG="The docker container was built outside of github actions and you didn't provide the build arg EDC_LAST_COMMIT_INFO_ARG, so there's no last commit info." | ||
ARG EDC_BUILD_DATE_ARG="The docker container was built outside of github actions and you didn't provide the build arg EDC_BUILD_DATE_ARG, so there's no build date." | ||
|
||
# Use "exec" for graceful termination (SIGINT) to reach JVM. | ||
# ARG can not be used in ENTRYPOINT so storing values in ENV variables | ||
ENV JVM_ARGS=$JVM_ARGS | ||
WORKDIR /app | ||
COPY ./launchers/connectors/$CONNECTOR_NAME/build/libs/app.jar /app | ||
COPY ./launchers/logging.properties /app | ||
COPY ./launchers/logging.dev.properties /app | ||
COPY ./launchers/.env.broker /app/.env | ||
|
||
# Read ENV Vars from .env with substitution | ||
COPY ./connector/.env /app/.env | ||
RUN touch /app/empty-properties-file.properties | ||
|
||
# Replaces ENV Var statements so they don't overwrite existing ENV Vars | ||
RUN sed -ri 's/^\s*(\S+)=(.*)$/\1=${\1:-"\2"}/' .env | ||
ENTRYPOINT set -a && source /app/.env && set +a && exec java -Djava.util.logging.config.file=/app/logging.properties $JVM_ARGS -jar app.jar | ||
ENTRYPOINT ["/app/entrypoint.sh"] | ||
CMD ["start"] | ||
|
||
# health status is determined by the availability of the /health endpoint | ||
HEALTHCHECK --interval=5s --timeout=5s --retries=10 CMD curl -H "x-api-key: $EDC_API_AUTH_KEY" --fail http://localhost:11001/backend/api/check/health |
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
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
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,38 @@ | ||
plugins { | ||
`java-library` | ||
id("application") | ||
alias(libs.plugins.shadow) | ||
} | ||
|
||
val edcVersion: String by project | ||
val edcGroup: String by project | ||
|
||
dependencies { | ||
// Control-Plane | ||
implementation("${edcGroup}:control-plane-core:${edcVersion}") | ||
implementation("${edcGroup}:data-plane-selector-core:${edcVersion}") | ||
implementation("${edcGroup}:api-observability:${edcVersion}") | ||
implementation("${edcGroup}:configuration-filesystem:${edcVersion}") | ||
implementation("${edcGroup}:control-plane-aggregate-services:${edcVersion}") | ||
implementation("${edcGroup}:http:${edcVersion}") | ||
implementation("${edcGroup}:dsp:${edcVersion}") | ||
implementation("${edcGroup}:json-ld:${edcVersion}") | ||
|
||
// JDK Logger | ||
implementation("${edcGroup}:monitor-jdk-logger:${edcVersion}") | ||
|
||
// Broker Server + PostgreSQL + Flyway | ||
implementation(project(":extensions:broker-server")) | ||
|
||
// Connector-To-Connector IAM | ||
implementation("${edcGroup}:iam-mock:${edcVersion}") | ||
} | ||
|
||
application { | ||
mainClass.set("org.eclipse.edc.boot.system.runtime.BaseRuntime") | ||
} | ||
|
||
tasks.withType<com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar> { | ||
mergeServiceFiles() | ||
archiveFileName.set("app.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
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