Files
windwiderstand/Dockerfile
T
Peter Meier 2fef91a548
Deploy / verify (push) Failing after 32s
Deploy / deploy (push) Has been skipped
Initial SvelteKit frontend port of windwiderstand.de
Full parity with Astro site: content rows, post/tag routes, pagination,
event badges + OSM map, comments, Live-Search via /api/search-index,
CMS image proxy, RSS, sitemap.

Deploy: Dockerfile + docker-compose.prod.yml + Gitea Actions workflow
to build + push to git.pm86.de registry and ssh-deploy to Contabo.
2026-04-17 22:01:30 +02:00

39 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.
# ─────────────────────────────────────────────
# Stage 1: Build
# ─────────────────────────────────────────────
FROM node:22-alpine AS builder
WORKDIR /app
# Erst nur package*.json besseres Layer-Caching
COPY package*.json ./
# postinstall versucht CMS-Types zu generieren (|| true → unkritisch ohne CMS)
RUN npm ci
COPY . .
RUN npm run build
# ─────────────────────────────────────────────
# Stage 2: Schlankes Production-Image
# ─────────────────────────────────────────────
FROM node:22-alpine AS runner
WORKDIR /app
ENV NODE_ENV=production
# Nur Production-Deps, kein postinstall nötig
COPY package*.json ./
RUN npm ci --omit=dev --ignore-scripts
# Build-Artefakt aus Stage 1
COPY --from=builder /app/build ./build
# Non-root user
RUN addgroup -g 1001 -S nodejs \
&& adduser -S svelte -u 1001 -G nodejs \
&& chown -R svelte:nodejs /app
USER svelte
EXPOSE 3001
ENV PORT=3001
CMD ["node", "build"]