Changeset 8951629 in Klonkt for Dockerfile
- Timestamp:
- 06/27/2026 01:24:08 PM (2 months ago)
- Branches:
- main
- Children:
- 8d054ca
- Parents:
- fcc9f25
- File:
-
- 1 edited
-
Dockerfile (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
Dockerfile
rfcc9f25 r8951629 1 1 # syntax=docker/dockerfile:1 2 2 # ────────────────────────────────────────────────────────────────────────── 3 # Klonkt — zelf-host image. Multi-stage: native deps compileren in een volle4 # image, dan een slanke runtime. ffmpeg wordt meegebundeld via ffmpeg-static5 # (npm), cwebp komt uit het Debian-pakket 'webp'.3 # Klonkt — self-host image. Multi-stage: compile native deps in a full 4 # image, then a slim runtime. ffmpeg is bundled via ffmpeg-static 5 # (npm), cwebp comes from the Debian 'webp' package. 6 6 # ────────────────────────────────────────────────────────────────────────── 7 7 8 # ---- builder: native modules (better-sqlite3) + ffmpeg-static ophalen----8 # ---- builder: fetch native modules (better-sqlite3) + ffmpeg-static ---- 9 9 FROM node:20-bookworm AS builder 10 10 WORKDIR /app 11 # Build -tools voor het geval better-sqlite3 from-source moet (andersprebuilt).11 # Build tools in case better-sqlite3 must build from source (otherwise prebuilt). 12 12 RUN apt-get update && apt-get install -y --no-install-recommends python3 make g++ \ 13 13 && rm -rf /var/lib/apt/lists/* 14 14 COPY package.json package-lock.json ./ 15 # Producti e-deps; install-scripts draaien (better-sqlite3 build + ffmpeg download).15 # Production deps; install scripts run (better-sqlite3 build + ffmpeg download). 16 16 RUN npm ci --omit=dev 17 17 … … 21 21 PORT=3000 22 22 WORKDIR /app 23 # cwebp = afbeelding→WebP (optioneel in de app, maar handig); ca-certificates24 # voor uitgaande HTTPS (license-server, SMTP, Google).23 # cwebp = image→WebP (optional in the app, but handy); ca-certificates 24 # for outbound HTTPS (license server, SMTP, Google). 25 25 RUN apt-get update && apt-get install -y --no-install-recommends webp ca-certificates \ 26 26 && rm -rf /var/lib/apt/lists/* 27 # node_modules (incl. gecompileerde better-sqlite3 + gebundelde ffmpeg) uitbuilder.27 # node_modules (incl. compiled better-sqlite3 + bundled ffmpeg) from builder. 28 28 COPY --from=builder /app/node_modules ./node_modules 29 # App -broncode.29 # App source code. 30 30 COPY . . 31 # Persistent e data leeft hier (DB, media, audio) — mount-punt voor eenvolume.31 # Persistent data lives here (DB, media, audio) — mount point for a volume. 32 32 RUN mkdir -p storage/media storage/audio && chown -R node:node /app 33 33 USER node 34 34 EXPOSE 3000 35 # Simp ele healthcheck via Node's ingebouwdefetch (Node 20).35 # Simple healthcheck via Node's built-in fetch (Node 20). 36 36 HEALTHCHECK --interval=30s --timeout=5s --start-period=20s --retries=3 \ 37 37 CMD node -e "fetch('http://127.0.0.1:'+(process.env.PORT||3000)+'/').then(r=>process.exit(r.ok?0:1)).catch(()=>process.exit(1))"
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)