Fix: build binary in dockerfile when running ci
Some checks failed
Go test / run-go-vet (push) Successful in 5s
Go test / check-swagger-up-to-date (push) Successful in 10s
Go test / run-go-test (push) Successful in 27s
Go test / cleanup-go-test (push) Successful in 14s
Go test / release-image (push) Failing after 57s

This commit is contained in:
2025-12-09 02:04:07 +08:00
parent 54c7659ee8
commit efc3f1ad89
2 changed files with 17 additions and 2 deletions

View File

@@ -1,6 +1,20 @@
FROM docker.io/library/debian:13-slim
FROM docker.io/library/golang:1.25 AS build
ADD backend /work/backend
WORKDIR /work
COPY . .
RUN make backend
FROM docker.io/library/debian:13-slim AS run
COPY --from=build /work/backend /work/backend
WORKDIR /work
ENTRYPOINT ["/work/backend"]
CMD ["serve"]
FROM docker.io/library/debian:13-slim AS testing
COPY backend /work/backend
WORKDIR /work
ENTRYPOINT ["/work/backend"]

View File

@@ -62,6 +62,7 @@ services:
backend:
build:
context: .
target: testing
env_file:
- path: ./.env
required: false