feat(betrieb): Docker Compose und LXC-Installer
Ein Laufzeit-Paket (scripts/paket-bauen.sh) für beide Wege: Next standalone, worker als Bundle mit nur den nötigen Paketen, Migrationen ohne Prisma-CLI. Compose lokal komplett hochgefahren; der Installer auf pve-demo in einem echten Debian-13-LXC durchgelaufen. Closes #019 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
+34
@@ -0,0 +1,34 @@
|
||||
# ProxDeploy – ein Image für app, worker und migrate. Gebaut wird mit scripts/paket-bauen.sh,
|
||||
# derselben Struktur wie im LXC-Installer.
|
||||
#
|
||||
# docker build --build-arg VERSION=0.6.0 -t proxdeploy:0.6.0 .
|
||||
|
||||
FROM node:24.21.0-trixie-slim AS bau
|
||||
ENV PNPM_HOME=/pnpm PATH=/pnpm:$PATH CI=true
|
||||
RUN corepack enable && corepack prepare pnpm@12.6.0 --activate
|
||||
WORKDIR /quelle
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends git ca-certificates && rm -rf /var/lib/apt/lists/*
|
||||
COPY package.json pnpm-lock.yaml pnpm-workspace.yaml ./
|
||||
COPY prisma ./prisma
|
||||
COPY prisma.config.ts ./
|
||||
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile
|
||||
COPY . .
|
||||
ARG VERSION
|
||||
# Ohne .git im Kontext gibt es keinen Commit; dann steht nur die Version da.
|
||||
RUN scripts/paket-bauen.sh "${VERSION:-$(node -p 'require("./package.json").version')}"
|
||||
|
||||
FROM node:24.21.0-trixie-slim
|
||||
LABEL org.opencontainers.image.title="ProxDeploy" \
|
||||
org.opencontainers.image.description="VMs und LXC-Container auf Proxmox VE ausrollen, per Web oder CLI." \
|
||||
org.opencontainers.image.source="https://git.wilde-server.de/florian.wilde/proxdeploy"
|
||||
ENV NODE_ENV=production PORT=3000 HOSTNAME=0.0.0.0 NEXT_TELEMETRY_DISABLED=1
|
||||
WORKDIR /opt/proxdeploy
|
||||
COPY --from=bau --chown=root:root /quelle/paket ./
|
||||
# Läuft als „node“ (UID 1000), nie als root; der Code gehört root und ist nicht beschreibbar.
|
||||
USER node
|
||||
WORKDIR /opt/proxdeploy/app
|
||||
EXPOSE 3000
|
||||
HEALTHCHECK --interval=30s --timeout=5s --start-period=20s \
|
||||
CMD node -e "fetch('http://127.0.0.1:'+(process.env.PORT||3000)+'/api/v1/gesundheit').then(r=>process.exit(r.ok?0:1)).catch(()=>process.exit(1))"
|
||||
# app; worker und migrate setzen ihr Kommando in docker-compose.yml.
|
||||
CMD ["node", "server.js"]
|
||||
Reference in New Issue
Block a user