diff --git a/.env.example b/.env.example index 356e653b..8b1a5356 100644 --- a/.env.example +++ b/.env.example @@ -21,6 +21,14 @@ NODE_ENV=development # [OPTIONAL] Server port (default: 3000) PORT=3000 +# [OPTIONAL] Maximum request body size for the Node server (default: 512K) +# adapter-node rejects larger request bodies with HTTP 413 before they reach the app, +# which silently breaks file uploads (conference base PDFs / images can be several MB; +# the Zod schema validates base PDFs up to 10MB each, and one save may include several). +# Set this above the largest expected upload. Accepts K/M/G suffixes; "Infinity" disables. +# Not enforced by the Vite dev server — only by the production (adapter-node) build. +# BODY_SIZE_LIMIT=64M + # [OPTIONAL] Public origin of the application (e.g. https://delegator.munify.cloud) # SvelteKit uses this for CSRF protection on form submissions and POST requests. # If not set, SvelteKit infers it from the Host header, which works when your reverse diff --git a/Dockerfile b/Dockerfile index 4bdfcc8a..ad40317c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -27,5 +27,11 @@ RUN bun run build:app && bun run check USER bun ENV NODE_ENV=production +# adapter-node caps request bodies at 512K by default and rejects anything larger with +# HTTP 413 before the request reaches the app. Conference document/image uploads (base +# PDFs are validated up to 10MB each in the Zod schema, and several can be sent in one +# save) exceed that. Raise the limit so uploads actually reach the server. Overridable at +# runtime via the BODY_SIZE_LIMIT env var (see .env.example). +ENV BODY_SIZE_LIMIT=64M EXPOSE 3000/tcp CMD ["sh", "-c", "bunx prisma migrate deploy && bun ./build/index.js"]