Files
Photography/Dockerfile
Kroonk 3ad76e841d
All checks were successful
Build & Push Docker Image to Gitea Registry / build-and-push (push) Successful in 30s
Rework Photography admin dashboard
2026-05-20 19:13:51 +02:00

48 lines
1.1 KiB
Docker

# === Build-Phase: Jekyll kompiliert die statische Website ===
FROM ruby:3.2-alpine AS builder
RUN apk add --no-cache build-base
WORKDIR /site
COPY Gemfile ./
RUN bundle install
COPY . .
RUN bundle exec jekyll build
# === Node-Dependencies: native sqlite3 mit Build-Tools bauen ===
FROM node:20-alpine AS node-deps
RUN apk add --no-cache python3 make g++ sqlite-dev
WORKDIR /app
COPY package*.json ./
RUN npm ci --omit=dev && npm cache clean --force
# === Serve-Phase: node.js backend + Runtime-Tools ===
FROM node:20-alpine
RUN apk add --no-cache imagemagick libjpeg-turbo libpng libwebp
RUN apk add --no-cache sqlite-libs
WORKDIR /app
COPY package*.json ./
COPY --from=node-deps /app/node_modules ./node_modules
COPY backend ./backend
COPY --from=builder /site/_site ./public
COPY entrypoint.sh /entrypoint.sh
# Behebt Windows CRLF Zeilenumbrueche, ansonsten stuerzt Alpine mit "sh\r: not found" ab!
RUN sed -i 's/\r$//' /entrypoint.sh
RUN chmod +x /entrypoint.sh
# Verzeichnisse anlegen
RUN mkdir -p /app/public/images/fulls /app/public/images/thumbs /app/data
EXPOSE 8090
ENTRYPOINT ["/entrypoint.sh"]