Initial commit: caddy static file server workspace

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-23 19:33:50 +08:00
commit a98b21114c
1438 changed files with 15044 additions and 0 deletions

30
caddy/CLAUDE.md Normal file
View File

@@ -0,0 +1,30 @@
# CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
## What this is
A Caddy static file server running in Docker Compose. It serves the `www/` directory at `:80` with directory browsing enabled. `www/` is a grab-bag of standalone, self-contained HTML pages (chart demos, QR/invoice scanners, Lit + Tailwind examples, a luopan compass, etc.) — there is no build step, bundler, or framework shared across them. Each `.html` file is opened directly by the browser; most pull their dependencies from CDNs inline.
## Commands
```sh
./run.sh # docker-compose up -d (start the server)
./stop.sh # docker-compose down
./list_docker_compose_services.sh # docker-compose ps
./view-output-from-containers.sh # docker-compose logs -f
./enter_caddy_container.sh # shell into the running container
```
After editing the `Caddyfile`, restart with `./stop.sh && ./run.sh` (the file is bind-mounted, not hot-reloaded). HTML files under `www/` are bind-mounted live — just refresh the browser.
## Layout
- `Caddyfile` — server config. Mounted to `/etc/caddy/Caddyfile`. Currently serves `/var/www/static` with `file_server browse` + gzip.
- `docker-compose.yaml` — single `caddy` service, bind-mounts `./Caddyfile`, `./caddy_data` (certs/state), and `./www``/var/www/static`. Port 80. `TZ=Asia/Taipei`.
- `www/` — served content. Add a new demo by dropping a `.html` file (and any asset subdir) here; it's immediately reachable at `http://localhost/<name>.html`.
## Notes
- Each HTML page stands alone. When editing one, don't assume shared CSS/JS with the others — check that file's own `<head>`.
- `*.tar.gz` and `*_BACKUP_*` / `*.ORIG-BACKUP_*` files in the repo are snapshots/backups, not live content.

8
caddy/Caddyfile Normal file
View File

@@ -0,0 +1,8 @@
:80 {
root * /var/www/static
encode gzip
# file_server
file_server browse
# respond "I am 80"
}

16
caddy/docker-compose.yaml Normal file
View File

@@ -0,0 +1,16 @@
services:
caddy:
image: caddy
container_name: caddy
volumes:
- ./Caddyfile:/etc/caddy/Caddyfile
- ./caddy_data:/data
- ./www:/var/www/static
ports:
# - "8000:8000"
- "80:80"
# - "443:443"
restart: unless-stopped
environment:
- TZ=Asia/Taipei

2
caddy/enter_caddy_container.sh Executable file
View File

@@ -0,0 +1,2 @@
#!/bin/bash
docker exec -it caddy sh

View File

@@ -0,0 +1,3 @@
#!/bin/sh
docker-compose ps

3
caddy/run.sh Executable file
View File

@@ -0,0 +1,3 @@
#!/bin/bash
# docker run -d --rm --name caddy --network=host -v $PWD/Caddyfile:/etc/caddy/Caddyfile -v $PWD/caddy_data:/data caddy
docker-compose up -d

4
caddy/stop.sh Executable file
View File

@@ -0,0 +1,4 @@
#!/bin/bash
# docker stop caddy
# docker system prune -f
docker-compose down

View File

@@ -0,0 +1,3 @@
#!/bin/sh
docker-compose logs -f

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Some files were not shown because too many files have changed in this diff Show More