Files
MrTerm/Dockerfile
T

30 lines
1.2 KiB
Docker
Raw 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.
# MrTerm Web – die MrTerm-Oberfläche im Browser, selbst gehostet.
# docker compose up -d → http://<server>:8080 (beim ersten Aufruf Admin-Konto anlegen)
# ---- Build: Server samt ssh2/ws in eine Datei bündeln
FROM node:22-alpine AS build
WORKDIR /src
COPY package.json package-lock.json ./
RUN npm ci --ignore-scripts --no-audit --no-fund
COPY src ./src
RUN npx esbuild src/web/server.js --bundle --platform=node --target=node22 --minify --legal-comments=none \
--external:electron --external:cpu-features --external:bufferutil --external:utf-8-validate \
--outfile=dist/server.js
# ---- Laufzeit: nur Node, gebündelter Server und die Dateien der Oberfläche
FROM node:22-alpine
ENV NODE_ENV=production PORT=8080 DATA_DIR=/data MRTERM_ROOT=/app
WORKDIR /app
COPY package.json ./
COPY --from=build /src/dist/server.js dist/server.js
COPY src/i18n.js src/i18n.js
COPY src/renderer src/renderer
COPY src/web/public src/web/public
COPY --from=build /src/node_modules/@xterm node_modules/@xterm
RUN mkdir -p /data && chown node:node /data
USER node
VOLUME /data
EXPOSE 8080
HEALTHCHECK --interval=30s --timeout=5s CMD wget -qO- http://127.0.0.1:8080/healthz >/dev/null || exit 1
CMD ["node", "dist/server.js"]