
Some checks failed
CI - 4NK Node / Code Quality (push) Failing after 1m0s
CI - 4NK Node / Unit Tests (push) Failing after 37s
CI - 4NK Node / Integration Tests (push) Successful in 37s
CI - 4NK Node / Security Tests (push) Failing after 34s
CI - 4NK Node / Docker Build & Test (push) Failing after 16s
CI - 4NK Node / Documentation Tests (push) Successful in 11s
CI - 4NK Node / Performance Tests (push) Successful in 33s
CI - 4NK Node / Notify (push) Failing after 1s
33 lines
1.0 KiB
Docker
33 lines
1.0 KiB
Docker
FROM rust:1 as wasm
|
|
WORKDIR /src
|
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
git curl pkg-config libssl-dev ca-certificates \
|
|
clang llvm lld build-essential \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
RUN curl -sSf https://rustwasm.github.io/wasm-pack/installer/init.sh | sh
|
|
RUN git clone -b docker-support https://git.4nkweb.com/4nk/sdk_client.git sdk_client
|
|
ENV CC=clang \
|
|
AR=llvm-ar \
|
|
CFLAGS_wasm32_unknown_unknown="--target=wasm32-unknown-unknown" \
|
|
TARGET_CC=clang
|
|
RUN wasm-pack build --out-dir /out/pkg ./sdk_client --target nodejs --release
|
|
|
|
FROM node:20-alpine AS deps
|
|
ENV NODE_ENV=development
|
|
WORKDIR /app
|
|
RUN apk add --no-cache python3 make g++
|
|
COPY package.json package-lock.json* ./
|
|
RUN npm ci
|
|
|
|
FROM node:20-alpine AS runner
|
|
ENV NODE_ENV=production
|
|
WORKDIR /app
|
|
RUN addgroup -S nodejs && adduser -S nodejs -G nodejs
|
|
COPY --from=deps /app/node_modules ./node_modules
|
|
COPY --from=wasm /out/pkg ./pkg
|
|
COPY tsconfig.json ./
|
|
COPY src ./src
|
|
EXPOSE 9090
|
|
USER nodejs
|
|
CMD ["node", "-r", "ts-node/register/transpile-only", "src/index.ts"]
|