From 8e8acdd859820dd0075cf44da512098b374de5be Mon Sep 17 00:00:00 2001 From: YoursFunny Date: Tue, 4 Aug 2026 23:11:04 +0800 Subject: [PATCH] deploy: add container names and startup order to compose --- AGENTS.md | 2 +- docker-compose.yml.example | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/AGENTS.md b/AGENTS.md index 37ace4f..3b2545c 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -72,7 +72,7 @@ Docker: `docker build -t tgxmb .` then `docker run --rm -d --name tgxmb --env-fi | `crates/x-media/src/site/pixiv/api.rs` | OAuth token exchange (hardcoded app client id/secret), access-token cache, ugoira zip→MP4 via ffmpeg in `spawn_blocking` | | `Dockerfile` | Multi-stage: cached dep layer via stub sources + `touch *.rs` mtime hack, static ffmpeg from ffmpeg.martin-riedl.de (`FFMPEG_URL` arg, `unzip -t` integrity check), `debian:bookworm-slim` runtime, entrypoint | | `docker-entrypoint.sh` | Privilege drop: `useradd` with `LOCAL_USER_ID` (default 9001) + `setpriv` (no gosu on bookworm-slim) | -| `docker-compose.yml.example` | Deployment env reference (real `docker-compose.yml` is gitignored). Ships nginx-proxy + acme-companion: webhook mode needs TLS termination in front (teloxide's axum listener is HTTP-only; `WEBHOOK_CERT` only feeds `set_webhook`), bot exposes `VIRTUAL_HOST`/`VIRTUAL_PORT` on the shared `proxy` network, no host port | +| `docker-compose.yml.example` | Deployment env reference (real `docker-compose.yml` is gitignored). Ships nginx-proxy + acme-companion: webhook mode needs TLS termination in front (teloxide's axum listener is HTTP-only; `WEBHOOK_CERT` only feeds `set_webhook`), bot exposes `VIRTUAL_HOST`/`VIRTUAL_PORT` on the shared `proxy` network, no host port; container names `nginx-proxy`/`acme-companion`/`tgxmb`, start order via `depends_on` (proxy → acme → bot) | | `.github/workflows/docker.yml` | CI: build+push to Docker Hub on tag `v*`/master; **no test step**; buildx gha cache (`cache-from`/`cache-to`, scope `tgxmb-build`, `mode=max`) so cargo deps + ffmpeg layers are restored across runs | | `README.md` | Feature docs + command table (Chinese) | diff --git a/docker-compose.yml.example b/docker-compose.yml.example index 9479def..d1a2be9 100644 --- a/docker-compose.yml.example +++ b/docker-compose.yml.example @@ -16,6 +16,7 @@ services: networks: [proxy] labels: - 'com.github.jrcs.letsencrypt_nginx_proxy_companion.nginx_proxy=true' + container_name: nginx-proxy acme-companion: image: nginxproxy/acme-companion @@ -29,6 +30,7 @@ services: - ./nginx-html:/usr/share/nginx/html:rw - ./nginx-acme:/etc/acme.sh networks: [proxy] + container_name: acme-companion depends_on: - nginx-proxy @@ -54,6 +56,8 @@ services: volumes: - ./data:/app/data networks: [proxy] + depends_on: + - nginx-proxy container_name: tgxmb networks: