research-notes/Dockerfile
jordan ea0d775163
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
fix: switch Dockerfile from pnpm to npm
Project uses npm (package-lock.json), but Dockerfile was configured
for pnpm causing frozen-lockfile errors in CI builds.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-09 23:05:33 -07:00

44 lines
1.0 KiB
Docker

# Build stage
FROM node:20-alpine AS builder
WORKDIR /app
# Asset URL for GCS storage
ARG NEXT_PUBLIC_ASSET_BASE_URL=https://storage.googleapis.com/orchard9-assets/research-notes
ENV NEXT_PUBLIC_ASSET_BASE_URL=$NEXT_PUBLIC_ASSET_BASE_URL
# Copy package files
COPY blog/package.json blog/package-lock.json ./
# Install dependencies
RUN npm ci
# Copy source
COPY blog/ .
# Build
RUN npm run build
# Runtime stage
FROM node:20-alpine AS runner
WORKDIR /app
ENV NODE_ENV=production
ENV PORT=3000
# Don't run as root
RUN addgroup --system --gid 1001 nodejs && \
adduser --system --uid 1001 nextjs
# Copy standalone build
COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./
COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static
COPY --from=builder --chown=nextjs:nodejs /app/public ./public
# Content is read at build time for SSG, but copy for any runtime needs
COPY --from=builder --chown=nextjs:nodejs /app/content ./content
USER nextjs
EXPOSE 3000
CMD ["node", "server.js"]