Drip-Creator / Dockerfile
Alexander Canji
fix(space): Docker SDK auf Port 7860, Secrets entfernt, PWA + API-Härtung
19e93fc
Raw History Blame Contribute Delete
1.14 kB
# ============================================================
# DRIP-CREATOR — Hugging Face Spaces (Docker SDK)
# Multi-Stage: Full Build → schlanke Production-Runtime
# HF-Anforderung: App lauscht auf 0.0.0.0:7860
# ============================================================
# ---------- Stage 1: Builder ----------
FROM node:20-slim AS builder
WORKDIR /app
ENV NEXT_TELEMETRY_DISABLED=1
# Dependencies (lockfile-exakt)
COPY package.json package-lock.json ./
RUN npm ci
# Quellcode + Build (braucht devDependencies: typescript, tailwind)
COPY . .
RUN npm run build
# ---------- Stage 2: Runner ----------
FROM node:20-slim AS runner
WORKDIR /app
ENV NODE_ENV=production \
NEXT_TELEMETRY_DISABLED=1 \
PORT=7860 \
HOSTNAME=0.0.0.0
RUN addgroup --system --gid 1001 nodejs \
&& adduser --system --uid 1001 nextjs
# Standalone-Server (enthält minimalen node_modules-Satz)
COPY --from=builder /app/public ./public
COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./
COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static
USER nextjs
EXPOSE 7860
CMD ["node", "server.js"]