From 7520bba192d5e5fdd0316c112826694008e7807a Mon Sep 17 00:00:00 2001 From: user Date: Sun, 15 Feb 2026 16:11:59 +0100 Subject: [PATCH] fix: mount src and data volumes in container targets Bind-mount src/ and data/ alongside plugins/ and config so the container picks up code changes without rebuilding. Update Makefile targets, compose file, and INSTALL.md to match. Co-Authored-By: Claude Opus 4.6 --- Makefile | 10 ++++++---- docker-compose.yml | 1 + docs/INSTALL.md | 9 +++++++-- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 9897bd0..94199a8 100644 --- a/Makefile +++ b/Makefile @@ -42,10 +42,12 @@ link: install ## Symlink to ~/.local/bin build: ## Build container image podman build -t $(APP_NAME) . -container-run: ## Run bot in container (mount config + plugins) +container-run: ## Run bot in container (mount code + config + data) podman run -d --name $(APP_NAME) \ - -v ./config/derp.toml:/app/config/derp.toml:ro,Z \ + -v ./src:/app/src:ro,Z \ -v ./plugins:/app/plugins:ro,Z \ + -v ./config/derp.toml:/app/config/derp.toml:ro,Z \ + -v ./data:/app/data:Z \ $(APP_NAME) container-stop: ## Stop and remove container @@ -57,8 +59,8 @@ container-logs: ## Follow container logs update-data: ## Download/refresh local data files ./scripts/update-data.sh -up: ## Start with podman-compose (build + detach) - podman-compose up -d --build +up: ## Start with podman-compose (detach) + podman-compose up -d down: ## Stop with podman-compose podman-compose down diff --git a/docker-compose.yml b/docker-compose.yml index eead387..070320c 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -9,4 +9,5 @@ services: - ./src:/app/src:ro,Z - ./plugins:/app/plugins:ro,Z - ./config/derp.toml:/app/config/derp.toml:ro,Z + - ./data:/app/data:Z command: ["--verbose"] diff --git a/docs/INSTALL.md b/docs/INSTALL.md index 374d6ad..9799897 100644 --- a/docs/INSTALL.md +++ b/docs/INSTALL.md @@ -54,12 +54,17 @@ make up ```bash podman build -t derp . podman run -d --name derp \ - -v ./config/derp.toml:/app/config/derp.toml:ro,Z \ + -v ./src:/app/src:ro,Z \ -v ./plugins:/app/plugins:ro,Z \ + -v ./config/derp.toml:/app/config/derp.toml:ro,Z \ + -v ./data:/app/data:Z \ derp --verbose ``` -The image contains only the Python package. Config and plugins are bind-mounted at runtime, so edits on the host are picked up by `!reload` without rebuilding. +The image contains only the Python runtime and compiled dependencies. Source +code, plugins, config, and data are bind-mounted at runtime. Code and plugin +edits on the host take effect on restart (or via `!reload` for plugins). +Only rebuild the image when adding or updating pip dependencies. ## Configuration