- Eltern-Ordner ist jetzt EIN Git-Repo (statt getrennter Repos). - root .gitignore haelt Secrets (.env), node_modules, DB und Build-Artefakte raus. - release.ps1: manueller Release (ZIP bauen + ans Backend laden). - root README mit Struktur und Release-Ablauf. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
25 lines
697 B
Docker
25 lines
697 B
Docker
# Node 20 on glibc so better-sqlite3 uses prebuilt binaries (no native build).
|
|
FROM node:20-bookworm-slim
|
|
|
|
ENV NODE_ENV=production
|
|
WORKDIR /app
|
|
|
|
# Install dependencies first for better layer caching.
|
|
COPY package.json ./
|
|
RUN npm install --omit=dev --no-audit --no-fund
|
|
|
|
# App source.
|
|
COPY src ./src
|
|
|
|
# Persistent data directory (mounted as a volume in compose).
|
|
RUN mkdir -p /data && chown -R node:node /data /app
|
|
VOLUME ["/data"]
|
|
|
|
USER node
|
|
EXPOSE 8080
|
|
|
|
HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \
|
|
CMD node -e "fetch('http://127.0.0.1:'+(process.env.PORT||8080)+'/healthz').then(r=>process.exit(r.ok?0:1)).catch(()=>process.exit(1))"
|
|
|
|
CMD ["node", "src/server.js"]
|