| 1 | # The source of truth server: file serving + the auto-indexer service. |
| 2 | # No bundling step; the whole source tree plus node_modules ship in the |
| 3 | # image and `node run` executes it the same way development does. |
| 4 | # |
| 5 | # trixie rather than bookworm: the dimensions processor needs the `magick` |
| 6 | # entry point, which is ImageMagick 7 (bookworm only packages v6). |
| 7 | from node:24-trixie |
| 8 | |
| 9 | # media processors shell out to these. exiftool is `libimage-exiftool-perl` |
| 10 | # on debian; curl is for the compose healthcheck. |
| 11 | run apt-get update && apt-get install -y --no-install-recommends \ |
| 12 | ffmpeg \ |
| 13 | imagemagick \ |
| 14 | libimage-exiftool-perl \ |
| 15 | curl \ |
| 16 | && rm -rf /var/lib/apt/lists/* |
| 17 | |
| 18 | workdir /app |
| 19 | copy package.json package-lock.json ./ |
| 20 | run npm ci --no-audit --no-fund |
| 21 | copy . . |
| 22 | # prime run.js's dependency hash so container boot never re-runs npm |
| 23 | run node run || true |
| 24 | |
| 25 | env PORT=80 |
| 26 | # must be configured |
| 27 | env CLOVER_DB=/dev/null |
| 28 | env CLOVER_FILE_RAW=/dev/null |
| 29 | env CLOVER_FILE_DERIVED=/dev/null |
| 30 | |
| 31 | cmd ["node", "run", "source-of-truth"] |