🤖 ci(docker): auto-build on push to main + fix root Dockerfile swag step

Enable Docker image build on every push to main (paths-ignore for docs-only changes mirrors webapp pattern). Fix root Dockerfile (shipped by #89) which was missing the swag init step required for //go:embed of swagger.json (gitignored).

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
This commit is contained in:
2026-05-06 07:05:10 +02:00
parent 63b892b10f
commit 99f729e5cf
2 changed files with 19 additions and 1 deletions

View File

@@ -14,6 +14,13 @@ RUN go mod download
# Copy entire source code
COPY . .
# Generate Swagger documentation if not already present
# (pkg/server/docs/ is gitignored ; the binary //go:embed depends on it)
RUN if [ ! -f pkg/server/docs/swagger.json ]; then \
go install github.com/swaggo/swag/cmd/swag@latest && \
cd pkg/server && go generate ; \
fi
# Build the server binary
RUN go build -o app ./cmd/server