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
30 lines
744 B
Markdown
30 lines
744 B
Markdown
# C3 - Cached Content Conduit
|
|
|
|
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.)
|
|
|