Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -951,6 +951,8 @@ jobs:

- name: Build & push core image
uses: docker/build-push-action@f9f3042f7e2789586610d6e8b85c8f03e5195baf # v7
env:
BUILDKIT_PROGRESS: plain
with:
context: /tmp/ghost-production
file: Dockerfile.production
Expand All @@ -967,6 +969,8 @@ jobs:

- name: Build & push full image
uses: docker/build-push-action@f9f3042f7e2789586610d6e8b85c8f03e5195baf # v7
env:
BUILDKIT_PROGRESS: plain
with:
context: /tmp/ghost-production
file: Dockerfile.production
Expand Down
17 changes: 11 additions & 6 deletions Dockerfile.production
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@ ARG NODE_VERSION=22.18.0
# ---- Core: server + production deps ----
FROM node:$NODE_VERSION-bookworm-slim AS core

ARG GHOST_BUILD_VERSION=""
ENV NODE_ENV=production
ENV GHOST_BUILD_VERSION=${GHOST_BUILD_VERSION}

RUN apt-get update && \
apt-get install -y --no-install-recommends libjemalloc2 fontconfig && \
Expand All @@ -25,26 +23,33 @@ RUN apt-get update && \

WORKDIR /home/ghost

COPY --exclude=core/built/admin . .

RUN corepack enable

COPY package.json pnpm-lock.yaml pnpm-workspace.yaml .npmrc ./
COPY components ./components

RUN --mount=type=cache,target=/root/.local/share/pnpm/store,id=pnpm-store \
apt-get update && \
apt-get install -y --no-install-recommends build-essential python3 && \
pnpm install --ignore-scripts --prod --prefer-offline && \
(cd node_modules/sqlite3 && npm run install) && \
apt-get purge -y build-essential python3 && \
apt-get autoremove -y && \
rm -rf /var/lib/apt/lists/* && \
mkdir -p default log && \
rm -rf /var/lib/apt/lists/*

COPY --exclude=core/built/admin . .

RUN mkdir -p default log && \
cp -R content base_content && \
cp -R content/themes/casper default/casper && \
([ -d content/themes/source ] && cp -R content/themes/source default/source || true) && \
chown ghost:ghost /home/ghost && \
chown -R nobody:nogroup /home/ghost/* && \
chown -R ghost:ghost /home/ghost/content /home/ghost/log

ARG GHOST_BUILD_VERSION=""
ENV GHOST_BUILD_VERSION=${GHOST_BUILD_VERSION}

USER ghost
ENV LD_PRELOAD=libjemalloc.so.2

Expand Down
Loading