Paper Sats: design and print paper notes that carry sats. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
24 lines
1004 B
Docker
24 lines
1004 B
Docker
# Production image for the web app. Build from the repository root:
|
|
# docker build -f infra/Dockerfile.web -t paper-sats-web .
|
|
# Also runs the database migrations (see docker-compose.prod.yml), which is why tsx stays installed.
|
|
FROM node:22-slim AS build
|
|
RUN corepack enable
|
|
WORKDIR /repo
|
|
COPY . .
|
|
RUN pnpm install --frozen-lockfile
|
|
# next build reads config at runtime only, so these placeholders never reach the image's runtime.
|
|
# A server started with them refuses to run, see packages/core/src/config.ts.
|
|
RUN APP_URL=http://build.invalid DATABASE_URL=postgres://build.invalid \
|
|
SESSION_SECRET=AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA= \
|
|
pnpm --filter @paper-sats/web exec next build
|
|
|
|
FROM node:22-slim
|
|
RUN useradd --create-home app
|
|
COPY --chown=app:app --from=build /repo /repo
|
|
WORKDIR /repo/apps/web
|
|
USER app
|
|
ENV NODE_ENV=production
|
|
EXPOSE 3000
|
|
# Node directly, not through pnpm, so SIGTERM reaches the server.
|
|
CMD ["node", "node_modules/next/dist/bin/next", "start", "--port", "3000"]
|