All checks were successful
Build & Push Docker Image / build-and-push (push) Successful in 1m52s
50 lines
1.2 KiB
Docker
50 lines
1.2 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
|
|
|
|
# Getrennte RUNs halten einzelne Registry-Layer klein genug fuer Proxy-Limits.
|
|
RUN apk add --no-cache docker-cli
|
|
RUN apk add --no-cache imagemagick
|
|
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"]
|