This commit is contained in:
2026-03-05 01:31:57 +01:00
parent 177aa6d44e
commit 5ae988cb6c
3 changed files with 17 additions and 3 deletions

View File

@@ -19,15 +19,15 @@ RUN CGO_ENABLED=0 GOOS=${GO_OS} GOARCH=${GO_ARCH} \
go build \
-installsuffix cgo \
-ldflags="-w -s -X 'main.APP_VERSION=${APP_VERSION}' -X 'main.COMMIT_ID=$(git log HEAD --oneline | awk '{print $1}' | head -n1)'" \
--o /app
--o /gocv
# Stage 2 · scratch image
FROM scratch
# Copy the necessary stuff from the build stage
COPY --from=build /app /app
COPY --from=build /gocv /gocv
# Copy the certificates - in case of fetches
COPY --from=build /etc/ssl/certs/ca-certificates.crt /etc/ssl/cert.pem
# Execute the binary
ENTRYPOINT ["/app"]
ENTRYPOINT ["/gocv serve"]

8
go.mod Normal file
View File

@@ -0,0 +1,8 @@
module git.bjphoster.com/source/go-cv
go 1.22.2
require (
github.com/gorilla/mux v1.8.1
gopkg.in/yaml.v2 v2.4.0
)

6
go.sum Normal file
View File

@@ -0,0 +1,6 @@
github.com/gorilla/mux v1.8.1 h1:TuBL49tXwgrFYWhqrNgrUNEY92u81SPhu7sTdzQEiWY=
github.com/gorilla/mux v1.8.1/go.mod h1:AKf9I4AEqPTmMytcMc0KkNouC66V3BtZ4qD5fmWSiMQ=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=