Files
afilmory/be/apps/core/Dockerfile
Innei 4cdb3bfd4e feat(static-web): implement static OG image generation service and add font support
- Updated Dockerfile to use Alpine variant for Node.js and added Perl installation.
- Introduced StaticOgService for generating Open Graph images with customizable templates.
- Added Geist-Medium font for rendering OG images.
- Updated TypeScript configuration to include JSX support and adjusted paths.
- Created type declarations for assets and Vercel OG module.
- Added new static assets for OG image generation.

Signed-off-by: Innei <tukon479@gmail.com>
2025-11-06 21:33:30 +08:00

47 lines
1.4 KiB
Docker

# syntax=docker/dockerfile:1.7
ARG NODE_VERSION=lts
ARG NODE_VARIANT=alpine
FROM node:${NODE_VERSION}-${NODE_VARIANT} AS builder
ENV PNPM_HOME=/pnpm
ENV PATH="$PNPM_HOME:$PATH"
RUN corepack enable && corepack prepare pnpm@10.19.0 --activate
WORKDIR /workspace
COPY package.json pnpm-workspace.yaml pnpm-lock.yaml ./
COPY be/apps/core/package.json be/apps/core/package.json
COPY be/apps/dashboard/package.json be/apps/dashboard/package.json
COPY apps/web/package.json apps/web/package.json
RUN pnpm fetch --filter core...
RUN pnpm fetch --filter '@afilmory/web...'
RUN pnpm fetch --filter '@afilmory/dashboard...'
COPY . .
RUN pnpm install --filter core... --filter '@afilmory/web...' --filter '@afilmory/dashboard...' --frozen-lockfile
RUN pnpm --filter core build:web
RUN pnpm --filter @afilmory/dashboard build
RUN pnpm --filter core build
RUN mkdir -p be/apps/core/dist/static/web && cp -r apps/web/dist/. be/apps/core/dist/static/web/
RUN mkdir -p be/apps/core/dist/static/dashboard && cp -r be/apps/dashboard/dist/. be/apps/core/dist/static/dashboard/
FROM node:${NODE_VERSION}-${NODE_VARIANT} AS runner
ENV NODE_ENV=production
WORKDIR /app
RUN apk add --no-cache perl
COPY --from=builder /workspace/be/apps/core/dist ./dist
COPY --from=builder /workspace/be/apps/core/drizzle ./drizzle
RUN if [ -f dist/package.json ]; then \
cd dist && \
npm install --omit=dev --no-audit --no-fund; \
fi
EXPOSE 1841
CMD ["node", "./dist/main.js"]