-
Notifications
You must be signed in to change notification settings - Fork 0
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
a62c2c6
commit 2526ef1
Showing
22 changed files
with
400 additions
and
266 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,130 @@ | ||
FROM eclipse-temurin:21 AS builder | ||
|
||
#^3 | ||
#patched | ||
#!3 | ||
|
||
ARG IS_PROD | ||
ARG FLAVOR | ||
ARG BUILD_ON_LOCAL_HOST | ||
ARG BUILD_ON_DOCKER | ||
ARG BUILD_ON_REMOTE_HOST | ||
ARG COMPOSE_PROFILES | ||
ARG COMPOSE_PROJECT_NAME | ||
ARG SEARCH_SERVICE | ||
ARG LUCENE_BASE_PATH | ||
ARG STACK_VERSION | ||
ARG CLUSTER_NAME | ||
ARG LICENSE | ||
ARG KIBANA_PORT | ||
ARG KIBANA_PASSWORD | ||
ARG ENCRYPTION_KEY | ||
ARG ELASTIC_URL | ||
ARG ES_PORT | ||
ARG CERTS_DIR | ||
ARG CERT_FILE | ||
ARG ELASTIC_NAME | ||
ARG ELASTIC_PASSWORD | ||
ARG MEDIA_SERVICE | ||
ARG MINIO_URL | ||
ARG MINIO_PORT | ||
ARG MINIO_PORT_CONSOLE | ||
ARG MINIO_NAME | ||
ARG MINIO_PASS | ||
ARG DATABASE_URI | ||
ARG DATABASE_PORT | ||
ARG DATABASE_DB | ||
ARG DATABASE_DRIVER | ||
ARG DATABASE_USER | ||
ARG DATABASE_PASS | ||
ARG DATABASE_FRONT_PORT | ||
ARG HMAC_KEY | ||
ARG BUNKER_VERSION | ||
ARG BUNKER_PORT | ||
ARG BUNKER_PORT_SECRET | ||
ARG SERVER_PORT | ||
ARG SERVER_URL | ||
ARG WS_SERVER_URL | ||
ARG PRESET_ENABLE | ||
ARG PRESET_WORKING_DIR | ||
ARG PRESET_SCRIPT | ||
ARG PRESET_ENCRYPTED_URI | ||
ARG PRESET_ENCRYPTED_PASSWORD | ||
#override | ||
ENV FLAVOR=generated-${FLAVOR} | ||
|
||
WORKDIR /app | ||
|
||
COPY . . | ||
|
||
COPY <<EOF ./${FLAVOR}.env | ||
IS_PROD=${IS_PROD} | ||
FLAVOR=${FLAVOR} | ||
BUILD_ON_LOCAL_HOST=${BUILD_ON_LOCAL_HOST} | ||
BUILD_ON_DOCKER=${BUILD_ON_DOCKER} | ||
BUILD_ON_REMOTE_HOST=${BUILD_ON_REMOTE_HOST} | ||
COMPOSE_PROFILES=${COMPOSE_PROFILES} | ||
COMPOSE_PROJECT_NAME=${COMPOSE_PROJECT_NAME} | ||
SEARCH_SERVICE=${SEARCH_SERVICE} | ||
LUCENE_BASE_PATH=${LUCENE_BASE_PATH} | ||
STACK_VERSION=${STACK_VERSION} | ||
CLUSTER_NAME=${CLUSTER_NAME} | ||
LICENSE=${LICENSE} | ||
KIBANA_PORT=${KIBANA_PORT} | ||
KIBANA_PASSWORD=${KIBANA_PASSWORD} | ||
ENCRYPTION_KEY=${ENCRYPTION_KEY} | ||
ELASTIC_URL=${ELASTIC_URL} | ||
ES_PORT=${ES_PORT} | ||
CERTS_DIR=${CERTS_DIR} | ||
CERT_FILE=${CERT_FILE} | ||
ELASTIC_NAME=${ELASTIC_NAME} | ||
ELASTIC_PASSWORD=${ELASTIC_PASSWORD} | ||
MEDIA_SERVICE=${MEDIA_SERVICE} | ||
MINIO_URL=${MINIO_URL} | ||
MINIO_PORT=${MINIO_PORT} | ||
MINIO_PORT_CONSOLE=${MINIO_PORT_CONSOLE} | ||
MINIO_NAME=${MINIO_NAME} | ||
MINIO_PASS=${MINIO_PASS} | ||
DATABASE_URI=${DATABASE_URI} | ||
DATABASE_PORT=${DATABASE_PORT} | ||
DATABASE_DB=${DATABASE_DB} | ||
DATABASE_DRIVER=${DATABASE_DRIVER} | ||
DATABASE_USER=${DATABASE_USER} | ||
DATABASE_PASS=${DATABASE_PASS} | ||
DATABASE_FRONT_PORT=${DATABASE_FRONT_PORT} | ||
HMAC_KEY=${HMAC_KEY} | ||
BUNKER_VERSION=${BUNKER_VERSION} | ||
BUNKER_PORT=${BUNKER_PORT} | ||
BUNKER_PORT_SECRET=${BUNKER_PORT_SECRET} | ||
SERVER_PORT=${SERVER_PORT} | ||
SERVER_URL=${SERVER_URL} | ||
WS_SERVER_URL=${WS_SERVER_URL} | ||
PRESET_ENABLE=${PRESET_ENABLE} | ||
PRESET_WORKING_DIR=${PRESET_WORKING_DIR} | ||
PRESET_SCRIPT=${PRESET_SCRIPT} | ||
PRESET_ENCRYPTED_URI=${PRESET_ENCRYPTED_URI} | ||
PRESET_ENCRYPTED_PASSWORD=${PRESET_ENCRYPTED_PASSWORD} | ||
EOF | ||
|
||
|
||
RUN find scripts/ -type f -name "*.sh" -exec sed -i 's/\r$//' {} + && \ | ||
sed -i 's/\r$//' gradlew | ||
|
||
ENV IS_LOCAL_HOST=false | ||
ENV IS_DOCKER=true | ||
|
||
RUN --mount=type=cache,target=/root/.gradle \ | ||
sh scripts/build_scripts/build-all-in-flavor.sh ${FLAVOR} ${IS_PROD} | ||
|
||
FROM eclipse-temurin:21 | ||
|
||
RUN mkdir /app | ||
|
||
WORKDIR /app | ||
COPY --from=builder /app/server/build/libs/*-all.jar ./ktor-server.jar | ||
COPY --from=builder /app/cli/build/distributions/cli.tar ./cli.tar | ||
COPY --from=builder /app/deploy/preset_data ./deploy/preset_data | ||
COPY scripts/tool_scripts/flush-database-singleton.sh ./scripts/tool_scripts/flush-database-singleton.sh | ||
RUN tar -xf ./cli.tar | ||
|
||
ENTRYPOINT ["java","-jar","./ktor-server.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
Oops, something went wrong.