mirror of
https://github.com/d0zingcat/BroadcastChannel.git
synced 2026-05-13 15:09:12 +00:00
To enhance security, Sentry authentication tokens and project IDs are now passed as environment variables instead of being exposed in the workflow configuration. This change reduces the risk of sensitive information leakage during the build process. Additionally, the example environment file has been updated to comment out the Sentry-related variables, further protecting against accidental exposure.
30 lines
681 B
Docker
30 lines
681 B
Docker
FROM node:lts-alpine AS base
|
|
|
|
ENV PNPM_HOME="/pnpm"
|
|
ENV PATH="$PNPM_HOME:$PATH"
|
|
RUN corepack enable
|
|
|
|
WORKDIR /app
|
|
COPY package.json pnpm-lock.yaml ./
|
|
|
|
# FROM base AS prod-deps
|
|
# RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --prod --frozen-lockfile
|
|
|
|
FROM base AS build-deps
|
|
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile
|
|
|
|
FROM build-deps AS build
|
|
COPY . .
|
|
RUN export $(cat .env.example) && \
|
|
export DOCKER=true && \
|
|
pnpm run build
|
|
|
|
FROM base AS runtime
|
|
# COPY --from=prod-deps /app/node_modules ./node_modules
|
|
COPY --from=build /app/dist ./dist
|
|
|
|
ENV HOST=0.0.0.0
|
|
ENV PORT=4321
|
|
EXPOSE 4321
|
|
CMD node ./dist/server/entry.mjs
|