build(docker): add docker builder

This commit is contained in:
2026-04-05 22:53:13 +03:00
parent 5a7d23f7e3
commit e8e7897d86
6 changed files with 164 additions and 100 deletions

28
Dockerfile Normal file
View File

@@ -0,0 +1,28 @@
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"]