41 lines
1.1 KiB
Docker
41 lines
1.1 KiB
Docker
# syntax=docker/dockerfile:1.7
|
|
FROM node:22-alpine AS build
|
|
|
|
# native builds for better-sqlite3
|
|
RUN apk add --no-cache python3 make g++ sqlite
|
|
|
|
WORKDIR /app
|
|
COPY package.json package-lock.json* ./
|
|
RUN --mount=type=cache,target=/root/.npm \
|
|
npm install --include=dev
|
|
|
|
COPY . .
|
|
RUN npm run build \
|
|
&& npm prune --omit=dev
|
|
|
|
# ---- runtime ----
|
|
FROM node:22-alpine
|
|
|
|
RUN apk add --no-cache sqlite tini rsync
|
|
|
|
WORKDIR /app
|
|
COPY --from=build /app/build ./build
|
|
COPY --from=build /app/node_modules ./node_modules
|
|
COPY --from=build /app/package.json ./package.json
|
|
COPY --from=build /app/src/lib/server/db/schema.sql ./build/schema.sql
|
|
COPY scripts/reset-admin.mjs ./scripts/reset-admin.mjs
|
|
COPY scripts/database-diagnostics.mjs ./scripts/database-diagnostics.mjs
|
|
COPY src/lib/server/auth/passwords.js ./src/lib/server/auth/passwords.js
|
|
COPY entrypoint.sh /entrypoint.sh
|
|
RUN chmod +x /entrypoint.sh
|
|
|
|
ENV NODE_ENV=production
|
|
ENV PORT=3000
|
|
ENV HOST=0.0.0.0
|
|
# Legacy host imports stream whole game files; buffering routes enforce their own caps.
|
|
ENV BODY_SIZE_LIMIT=Infinity
|
|
ENV SQLITE_TMPDIR=/data/.sqlite-tmp
|
|
EXPOSE 3000
|
|
|
|
ENTRYPOINT ["/sbin/tini", "--", "/entrypoint.sh"]
|