learning_ai_notes/web/Dockerfile
root fa00722a39 revert(docker): revert to docker-prep.sh approach due to workspace complexity
The base image approach is too complex for the current pnpm workspace structure.
Products cannot easily use the base image's workspace because pnpm expects all
workspace packages to be present during install. Reverting to the proven
docker-prep.sh tarball approach for now.

Generated with [Devin](https://cli.devin.ai/docs)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-05-09 23:35:37 +00:00

43 lines
1.2 KiB
Docker

FROM node:22-slim AS builder
WORKDIR /app/web
ARG GITEA_NPM_HOST
ENV NODE_TLS_REJECT_UNAUTHORIZED=0
ENV NPM_CONFIG_STRICT_SSL=false
ENV GITEA_NPM_HOST=$GITEA_NPM_HOST
RUN npm config set strict-ssl false \
&& npm install -g pnpm@10.6.5
COPY .npmrc.docker ./.npmrc
COPY .docker-deps/ /app/.docker-deps/
COPY web/package.json ./package.json
RUN --mount=type=secret,id=gitea_npm_token \
export GITEA_NPM_TOKEN="$(cat /run/secrets/gitea_npm_token 2>/dev/null || echo '')" && \
pnpm install --ignore-scripts --lockfile=false
COPY web/next.config.ts ./next.config.ts
COPY web/tsconfig.json ./tsconfig.json
COPY web/next-env.d.ts ./next-env.d.ts
COPY web/src/ ./src/
COPY shared/ ../shared/
ARG NEXT_PUBLIC_NOTES_API_URL
ARG NEXT_PUBLIC_PLATFORM_SERVICE_URL
ENV NEXT_PUBLIC_NOTES_API_URL=$NEXT_PUBLIC_NOTES_API_URL
ENV NEXT_PUBLIC_PLATFORM_SERVICE_URL=$NEXT_PUBLIC_PLATFORM_SERVICE_URL
ENV NEXT_TELEMETRY_DISABLED=1
RUN pnpm run build
FROM node:22-slim
WORKDIR /app/web
ENV NODE_ENV=production
ENV NEXT_TELEMETRY_DISABLED=1
COPY --from=builder /app/web/.next/standalone ./
COPY --from=builder /app/web/.next/static ./.next/static
EXPOSE 3045
ENV PORT=3045
CMD ["node", "web/server.js"]