From d82116048529d04fe6c4f0144a5c57d997649fcf Mon Sep 17 00:00:00 2001 From: Mark Kalsbeek Date: Sat, 8 Aug 2026 16:31:34 +0200 Subject: [PATCH] Add staging volume and docker exec workflow docs distroless has no shell, so managing packages against a running container means exec-ing the ccc binary directly. Files being added need to exist inside the container already, so bind-mount a host ./staging dir to /staging for that. - docker-compose.yml: mount ./staging:/staging alongside the data volume - README: document docker compose exec + staging workflow --- .gitignore | 2 ++ README.md | 25 +++++++++++++++++++++++++ docker-compose.yml | 3 +++ staging/.gitkeep | 0 4 files changed, 30 insertions(+) create mode 100644 staging/.gitkeep diff --git a/.gitignore b/.gitignore index 16f508f..2f84347 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ /target *.db +/staging/* +!/staging/.gitkeep diff --git a/README.md b/README.md index f969a8d..d9f59ba 100644 --- a/README.md +++ b/README.md @@ -2,3 +2,28 @@ My super simple CDN built for distributing my own (text) content. +## Running in Docker + +``` +docker compose up -d +``` + +The runtime image is `distroless` (no shell, no package manager, ~24MB), +so managing packages happens via `docker exec` running the `ccc` binary +directly rather than an interactive shell: + +``` +docker compose exec ccc /usr/local/bin/ccc create demo +``` + +To add a file, it needs to exist inside the container first. Drop it in +the `./staging` dir, which is bind-mounted to `/staging`: + +``` +cp app.js staging/ +docker compose exec ccc /usr/local/bin/ccc add demo /staging/app.js 1.0.0 +``` + +(Alternatively `docker cp` a file straight into the container if you'd +rather not use the staging mount.) + diff --git a/docker-compose.yml b/docker-compose.yml index 16242f6..4abad35 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -5,6 +5,9 @@ services: - "8333:8333" volumes: - ccc-data:/data + # Bind-mount a host dir here to stage files for `ccc add`, e.g.: + # docker compose exec ccc /usr/local/bin/ccc add demo /staging/app.js 1.0.0 + - ./staging:/staging restart: unless-stopped volumes: diff --git a/staging/.gitkeep b/staging/.gitkeep new file mode 100644 index 0000000..e69de29