deploy: build on every service so build <svc> can't no-op

build: . lived only on mavend, so `docker compose build mavweb` (or any other
module) silently built nothing and redeployed a stale mavenai:latest — a fixed
binary looked deployed but wasn't. Moved build into the shared anchor; same
image name means it's still built once, but naming any service now rebuilds.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
kami
2026-07-03 23:40:10 +04:00
parent 9e2a9690bf
commit de8fd9ba90
+4 -1
View File
@@ -9,13 +9,16 @@ x-image: &image
# NOT "maven" — that's Apache Maven on Docker Hub and compose will happily
# pull it, giving every container `mvn-entrypoint.sh` and exit 127.
image: mavenai:latest
# build on EVERY service (same image name ⇒ built once) so `docker compose
# build <anyservice>` actually rebuilds. With build on only one service, the
# others silently no-op and you deploy a stale binary.
build: .
pull_policy: never # only ever the locally-built image
restart: unless-stopped
services:
mavend:
<<: *image
build: .
command: ["mavend", "-config", "/opt/maven/config/mavend.json"]
# the key lives ONLY here. deploy/db_key.env holds MAVEN_DB_KEY=<base64-32B>.
env_file: [./deploy/db_key.env]