# === 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 # === Serve-Phase: node.js backend + ImageMagick === FROM node:20-alpine # Install build dependencies for sqlite3 native bindings on Alpine RUN apk add --no-cache imagemagick docker-cli python3 make g++ build-base sqlite-dev WORKDIR /app COPY package*.json ./ RUN npm install --omit=dev 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 80 ENTRYPOINT ["/entrypoint.sh"]