- deploy-vps.sh: free-warez.top → free-warez.win (eldov.win liegt auf .win, nicht .top). Vorheriger Deploy lief auf .top ohne Traefik-Routing. - docker-compose.yml: Traefik-Labels analog w-make-com (Router für eldov.win + www.eldov.win, websecure entrypoint, HTTP→HTTPS-Redirect). Service hängt am 'proxy'-Netzwerk. - next.config.ts: Rewrites als Backup zum proxy.ts (/ → /de, /projekte/[slug] → /de/projects/[slug]). In manchen Setups greift der proxy.ts nicht zuverlässig für statische Routen — doppelt hält besser. - src/app/page.tsx: Root-Route serviert DE-Inhalt direkt, damit Healthchecks und Bots eine echte Antwort bekommen (kein endloser Redirect).
38 lines
1.3 KiB
Docker
38 lines
1.3 KiB
Docker
# Multi-Stage Build: deps → build → runner.
|
|
# Analog w-make-com, aber standalone mit bereits gebauter Next.js App.
|
|
|
|
FROM node:22.13-bookworm-slim AS deps
|
|
WORKDIR /app
|
|
RUN apt-get update && apt-get install -y --no-install-recommends python3 build-essential ca-certificates \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
COPY package.json package-lock.json* ./
|
|
RUN npm ci
|
|
|
|
FROM deps AS build
|
|
WORKDIR /app
|
|
COPY . .
|
|
ARG NEXT_PUBLIC_SITE_URL=https://eldov.win
|
|
ENV NEXT_PUBLIC_SITE_URL=${NEXT_PUBLIC_SITE_URL}
|
|
ENV NEXT_TELEMETRY_DISABLED=1
|
|
RUN npm run build
|
|
|
|
FROM node:22.13-bookworm-slim AS runner
|
|
WORKDIR /app
|
|
ENV NODE_ENV=production NEXT_TELEMETRY_DISABLED=1 PORT=3000
|
|
# Non-Root
|
|
RUN groupadd --system --gid 1001 nodejs \
|
|
&& useradd --system --uid 1001 --gid nodejs eldov
|
|
# Standalone-Output kopieren (Next.js legt ihn unter .next/standalone an,
|
|
# wenn output: 'standalone' gesetzt ist; hier vorerst klassischer next start).
|
|
COPY --from=build /app/.next ./.next
|
|
COPY --from=build /app/public ./public
|
|
COPY --from=build /app/src ./src
|
|
COPY --from=build /app/package.json ./package.json
|
|
COPY --from=build /app/next.config.ts ./next.config.ts
|
|
COPY --from=build /app/proxy.ts ./proxy.ts
|
|
COPY --from=build /app/node_modules ./node_modules
|
|
RUN mkdir -p /app/data && chown -R eldov:nodejs /app
|
|
USER eldov
|
|
EXPOSE 3000
|
|
CMD ["npm", "run", "start"]
|