Reduce Docker image layer size
All checks were successful
Build & Push Docker Image / build-and-push (push) Successful in 1m52s
All checks were successful
Build & Push Docker Image / build-and-push (push) Successful in 1m52s
This commit is contained in:
@@ -2,6 +2,7 @@ _site/
|
|||||||
.git/
|
.git/
|
||||||
.claude/
|
.claude/
|
||||||
node_modules/
|
node_modules/
|
||||||
|
images/
|
||||||
.sass-cache/
|
.sass-cache/
|
||||||
.jekyll-metadata
|
.jekyll-metadata
|
||||||
*.md
|
*.md
|
||||||
|
|||||||
21
Dockerfile
21
Dockerfile
@@ -12,15 +12,26 @@ COPY . .
|
|||||||
|
|
||||||
RUN bundle exec jekyll build
|
RUN bundle exec jekyll build
|
||||||
|
|
||||||
# === Serve-Phase: node.js backend + ImageMagick ===
|
# === Node-Dependencies: native sqlite3 mit Build-Tools bauen ===
|
||||||
FROM node:20-alpine
|
FROM node:20-alpine AS node-deps
|
||||||
|
|
||||||
# ImageMagick fuer Thumbnails, Docker CLI fuer Admin-Sync, Build-Tools fuer sqlite3 native bindings
|
RUN apk add --no-cache python3 make g++ sqlite-dev
|
||||||
RUN apk add --no-cache imagemagick docker-cli python3 make g++ build-base sqlite-dev
|
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
COPY package*.json ./
|
COPY package*.json ./
|
||||||
RUN npm install --omit=dev
|
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 backend ./backend
|
||||||
COPY --from=builder /site/_site ./public
|
COPY --from=builder /site/_site ./public
|
||||||
|
|||||||
Reference in New Issue
Block a user