File size: 1,135 Bytes
19e93fc
 
 
 
 
 
 
 
7f9a372
 
 
19e93fc
7f9a372
19e93fc
 
 
7f9a372
19e93fc
7f9a372
 
 
19e93fc
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7f9a372
19e93fc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# ============================================================
# 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"]