Files
BroadcastChannel/Dockerfile
ccbikai bf2ecfe7a0 refactor: improve security by moving Sentry secrets to environment variables
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.
2024-10-15 21:11:47 +08:00

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