mirror of
https://github.com/d0zingcat/BroadcastChannel.git
synced 2026-05-14 07:26:50 +00:00
- Introduce .dockerignore for Docker build optimization - Add Dockerfile for containerization setup - Update .env.example to clear Sentry variables and rename HOST to TELEGRAM_HOST - Modify astro.config.mjs to conditionally exclude SSR dependencies in Docker builds - Adjust postinstall script to safely handle missing .git directory - Refactor telegram host retrieval for clarity and consistency
28 lines
669 B
Docker
28 lines
669 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
|