Skip to content

Moved WORKDIR to /var/lib/ghost and added community Docker target#27314

Draft
rob-ghost wants to merge 1 commit intomainfrom
chore/dockerfile-cleanup-workdir
Draft

Moved WORKDIR to /var/lib/ghost and added community Docker target#27314
rob-ghost wants to merge 1 commit intomainfrom
chore/dockerfile-cleanup-workdir

Conversation

@rob-ghost
Copy link
Copy Markdown
Contributor

@rob-ghost rob-ghost commented Apr 9, 2026

refs BER-3398, BER-3399

The community Docker image (docker-library/ghost) is maintained by external contributors, and updates consistently lag behind Ghost releases because they depend on community PRs through docker-library/official-images. We want to publish our own tryghost/ghost image to Docker Hub that's a zero-change migration for the tens of thousands of self-hosters currently using the community image.

To make that work, our production Dockerfile needs to match the conventions the community image established — primarily WORKDIR /var/lib/ghost (so existing volume mounts and compose files just work) and content seeding on first boot (so a fresh named volume gets default themes and scaffolding). This PR makes those alignment changes and adds a community build target that layers the entrypoint, config, and VOLUME declaration on top of the existing full target.

The WORKDIR move from /home/ghost to /var/lib/ghost also cleaned up some dead code from the legacy Pro source-build era — unused default/ directory creation and theme copies that nothing references. The log/ directory creation was moved to Dockerfile.pro where it belongs since Ghost itself writes logs to content/logs/, not a top-level log/ dir.

The community target is not built or published in CI yet — that comes with BER-3400 when we're ready to push to Docker Hub. For now, it can be built locally with docker build --target community.

Merge Ghost-Moya#210 after this lands to align the Pro container and PR preview tooling with the new WORKDIR.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 9, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: f6c011fe-e59f-49ef-80f4-7cf83fd73faa

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/dockerfile-cleanup-workdir

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 9, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 73.42%. Comparing base (8ea5257) to head (f8d105d).
⚠️ Report is 4 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #27314      +/-   ##
==========================================
- Coverage   73.48%   73.42%   -0.06%     
==========================================
  Files        1551     1552       +1     
  Lines      124558   124674     +116     
  Branches    15070    15073       +3     
==========================================
+ Hits        91528    91545      +17     
- Misses      32024    32103      +79     
- Partials     1006     1026      +20     
Flag Coverage Δ
admin-tests 54.38% <ø> (+0.01%) ⬆️
e2e-tests 73.42% <ø> (-0.06%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@rob-ghost rob-ghost force-pushed the chore/dockerfile-cleanup-workdir branch from 963f2c3 to c01ba9f Compare April 14, 2026 13:16
Context: the previous WORKDIR (/home/ghost) conflicted with the home
directory convention. Moving to /var/lib/ghost follows the FHS standard
for application state and aligns with the official Ghost Docker image
path. The new `community` build target layers an entrypoint script and
default config on top of the `full` target, seeding content from
base_content into a named volume at startup — preparing for the future
Docker Hub image.
@rob-ghost rob-ghost force-pushed the chore/dockerfile-cleanup-workdir branch from c01ba9f to f8d105d Compare April 15, 2026 15:01
@sonarqubecloud
Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant