29 lines
845 B
Docker
29 lines
845 B
Docker
FROM ubuntu:noble AS base
|
|
RUN apt update && apt install -y \
|
|
nodejs \
|
|
npm \
|
|
openjdk-11-jre \
|
|
protobuf-compiler \
|
|
jq
|
|
RUN node -v
|
|
RUN npm -v
|
|
|
|
FROM base AS builder
|
|
ENV GRADLE_USER_HOME=/sdk/gradle
|
|
WORKDIR /app
|
|
COPY package.json package-lock.json ./
|
|
RUN npm ci
|
|
COPY gulpfile.js protohx.json ./
|
|
COPY tasks ./tasks
|
|
COPY config.example.json ./config.example.json
|
|
RUN --mount=type=secret,id=KEY_STORE \
|
|
cat /run/secrets/KEY_STORE > ./key.jks
|
|
RUN --mount=type=secret,id=KEY_PASS,env=KEY_PASS \
|
|
jq --arg key_pass "$KEY_PASS" \
|
|
'.SdkDir = "/sdk" | .PublishDir = "/app/publish" | .Key.store = "key.jks" | .Key.pass = $key_pass' \
|
|
config.example.json > config.json
|
|
COPY src ./src
|
|
#COPY dependencies ./dependencies
|
|
VOLUME ["/sdk", "/app/build", "/app/target", "/app/publish", "/app/src-gen"]
|
|
CMD ["npx", "gulp", "default"]
|