21 lines
1.1 KiB
Docker
21 lines
1.1 KiB
Docker
# --- Build stage ---
|
|
FROM node:22-alpine AS build
|
|
WORKDIR /app
|
|
COPY package.json ./
|
|
RUN npm install
|
|
COPY . .
|
|
# Selbst gehostete Bilder: Unsplash-Assets zur Build-Zeit holen und ins eigene Image backen
|
|
# (kein Client-Hotlink zu Unsplash -> DSGVO-freundlich). Credits: /bildnachweis
|
|
RUN apk add --no-cache curl && mkdir -p public/img \
|
|
&& curl -fsSL "https://images.unsplash.com/photo-1649711895336-20ff39db62f8?w=1680&q=72&fm=jpg&fit=crop&auto=format" -o public/img/hero-klima.jpg \
|
|
&& curl -fsSL "https://images.unsplash.com/photo-1752218804012-3e7db92274ec?w=1000&q=72&fm=jpg&fit=crop&auto=format" -o public/img/alarm-phone.jpg \
|
|
&& curl -fsSL "https://images.unsplash.com/photo-1583444012262-00185bf33cc6?w=160&h=160&q=72&fm=jpg&fit=crop&auto=format" -o public/img/brand-water.jpg \
|
|
&& for f in hero-klima alarm-phone brand-water; do test -s "public/img/$f.jpg" || (echo "FEHLT: $f" && exit 1); done
|
|
RUN npm run build
|
|
|
|
# --- Serve stage ---
|
|
FROM nginx:1.27-alpine
|
|
COPY --from=build /app/dist /usr/share/nginx/html
|
|
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
|
EXPOSE 80
|