# 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 entrypoint.sh /entrypoint.sh RUN chmod +x /entrypoint.sh ENV NODE_ENV=production ENV PORT=3000 ENV HOST=0.0.0.0 EXPOSE 3000 ENTRYPOINT ["/sbin/tini", "--", "/entrypoint.sh"]