Files
sshkeyvault/Dockerfile
T
florian.wildeandClaude Opus 5.5 4a23930b54 feat(worker): Worker mit pg-boss, Vorgaenge und Docker-Betrieb (#007)
Die Oberflaeche legt einen Vorgang an und schickt nur dessen ID in die
Warteschlange; der Worker fuehrt ihn aus und haelt Status, Ergebnis
oder Fehler fest. So bleiben lange SSH-Vorgaenge aus dem Webprozess
heraus, und der Fortschritt ist ohne Job-Interna sichtbar.

Kein automatisches Wiederholen: ein halb ausgefuehrter Schreibvorgang
auf einem Host gehoert vor einen Menschen. Fehlertexte aus fremden
Bibliotheken erreichen die Oberflaeche nie.

Dockerfile und Compose fuer den Betrieb: Master-Key als Secret nur im
Worker, Datenbank in einem internen Netz.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 09:21:41 +02:00

40 lines
1.4 KiB
Docker
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# SSHKeyVault – ein Abbild fuer Weboberflaeche und Worker; sie unterscheiden sich nur im Startbefehl.
FROM node:24-alpine AS basis
WORKDIR /app
# openssl braucht Prisma, tini beendet Prozesse sauber.
RUN apk add --no-cache openssl tini && corepack enable
# ---------------------------------------------------------------- Abhaengigkeiten
FROM basis AS abhaengigkeiten
COPY package.json pnpm-lock.yaml pnpm-workspace.yaml ./
COPY prisma ./prisma
COPY prisma.config.ts ./
RUN pnpm install --frozen-lockfile --ignore-scripts
# ---------------------------------------------------------------- Bauen
FROM abhaengigkeiten AS bauen
COPY . .
RUN pnpm prisma generate && pnpm build && pnpm build:worker
# ---------------------------------------------------------------- Laufzeit
FROM basis AS laufzeit
ENV NODE_ENV=production
ENV PORT=3400
# Sonst bindet Next an den von Docker gesetzten HOSTNAME und der Healthcheck ueber
# 127.0.0.1 schlaegt fehl.
ENV HOSTNAME=0.0.0.0
RUN addgroup -g 1001 -S sshkv && adduser -S sshkv -u 1001 -G sshkv
COPY --from=bauen --chown=sshkv:sshkv /app/.next/standalone ./
COPY --from=bauen --chown=sshkv:sshkv /app/.next/static ./.next/static
COPY --from=bauen --chown=sshkv:sshkv /app/public ./public
COPY --from=bauen --chown=sshkv:sshkv /app/dist ./dist
COPY --chown=sshkv:sshkv deploy/start.sh ./start.sh
USER sshkv
EXPOSE 3400
ENTRYPOINT ["/sbin/tini", "--"]
CMD ["./start.sh", "web"]