dev-up
Boots the al-folio Jekyll site for local preview at http://localhost:8080.
Procedure
Check Docker daemon. Run
docker info. If it fails with "Cannot connect to the Docker daemon", runopen -a Docker, then poll withuntil docker info >/dev/null 2>&1; do sleep 2; done(timeout 120s).Verify the local image exists. Run
docker image inspect amirpourmand/al-folio:latest >/dev/null 2>&1. If it doesn't exist, or ifDockerfile/Gemfile/Gemfile.lockare newer than the image, rundocker compose build(background, ~3-5 min on cache-warm rebuild). Do not usedocker compose pull— the published image on Docker Hub is broken (Bundler version mismatch with this repo's lockfile).Start the server. Run
docker compose upin the background. Stream the log file and watch forServer address: http://0.0.0.0:8080(success) or any ofError|GemNotFound|bundler: failed|LoadError|Traceback|fatal(failure).Restore Gemfile.lock. The container's
bin/entry_point.shrunsrm -f Gemfile.lockon startup. The repo is bind-mounted, so the deletion propagates to the host. After the server is up, rungit checkout HEAD -- Gemfile.lockto restore it. (If the user is intentionally regenerating dependencies, skip this step.)Report. Tell the user the URL (
http://localhost:8080), that auto-rebuild is enabled (~3-10s after edits to_pages/,_news/,_projects/,_bibliography/,_data/,_config.yml), and how to stop (docker compose down).
Failure modes to watch for
bigdecimal/bundlerversion conflicts during build. The Dockerfile is pinned toruby:3.3to match the lockfile'sbigdecimal 3.1.8. Newer Ruby shipsbigdecimal 4.xand breaks the lockfile. Do not changeFROM ruby:3.3without updating the lockfile too.Could not find gem 'jekyll-archives' in locally installed gemsduringdocker compose up. This means the image is the broken Hub one. Rundocker compose buildto rebuild from the local Dockerfile.failed to compute cache key: "Gemfile.lock": not foundduring build. The host'sGemfile.lockwas deleted by a prior container run. Rungit checkout HEAD -- Gemfile.lockand retry.
Don't
- Don't run
docker compose pull— overwrites the locally-built working image with the broken Hub one. - Don't commit
Gemfile.lockchanges that came from a Docker run — they're transient.
Source: Tungthanhlee/tungthanhlee.github.io — distributed by TomeVault.