Bugfix to accommodate private upstream repository for feedapi
Some checks failed
ci/woodpecker/push/build-image Pipeline failed
Some checks failed
ci/woodpecker/push/build-image Pipeline failed
This commit is contained in:
12
Dockerfile
12
Dockerfile
@@ -8,6 +8,8 @@ ARG GO_VERSION=1.25
|
||||
FROM harbor.maximumdirect.net/proxy-dockerhub/golang:${GO_VERSION}-bookworm AS build
|
||||
|
||||
WORKDIR /src
|
||||
ENV GOPRIVATE=gitea.maximumdirect.net/ejr/* \
|
||||
GONOSUMDB=gitea.maximumdirect.net/ejr/*
|
||||
|
||||
# Install baseline packages
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
@@ -17,15 +19,11 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
# Cache dependencies first
|
||||
COPY go.mod go.sum ./
|
||||
RUN --mount=type=cache,target=/go/pkg/mod \
|
||||
go mod download
|
||||
go mod download && go mod verify
|
||||
|
||||
# Copy the rest of the source
|
||||
COPY . .
|
||||
|
||||
# Ensure go.sum is complete after dropping the replace
|
||||
RUN --mount=type=cache,target=/go/pkg/mod \
|
||||
--mount=type=cache,target=/root/.cache/go-build
|
||||
|
||||
# Default to a static build (no CGO)
|
||||
# If errors, can build with: --build-arg CGO_ENABLED=1
|
||||
ARG CGO_ENABLED=0
|
||||
@@ -71,8 +69,10 @@ RUN useradd \
|
||||
|
||||
# Copy the binary
|
||||
COPY --chown=weatherapi:weatherapi --from=build /out/weatherapi /weatherapi/weatherapi
|
||||
COPY --chown=weatherapi:weatherapi config.yml /weatherapi/config.yml
|
||||
COPY --chown=weatherapi:weatherapi templates /weatherapi/templates
|
||||
|
||||
USER weatherapi
|
||||
|
||||
# The application expects config.yml in the same directory as the binary
|
||||
ENTRYPOINT ["/weatherapi/weatherapi"]
|
||||
ENTRYPOINT ["/weatherapi/weatherapi"]
|
||||
|
||||
4
go.mod
4
go.mod
@@ -9,7 +9,3 @@ require (
|
||||
)
|
||||
|
||||
require gopkg.in/yaml.v3 v3.0.1 // indirect
|
||||
|
||||
replace gitea.maximumdirect.net/ejr/feedapi => ../feedapi
|
||||
|
||||
replace gitea.maximumdirect.net/ejr/weatherfeeder => ../weatherfeeder
|
||||
|
||||
4
go.sum
4
go.sum
@@ -1,3 +1,7 @@
|
||||
gitea.maximumdirect.net/ejr/feedapi v0.1.0 h1:ZB5QWKD5DPFV3P7vyeJqXPMcSWN9qHkDUHw1LgN9hwY=
|
||||
gitea.maximumdirect.net/ejr/feedapi v0.1.0/go.mod h1:3fIaFFx4ywt0TWbN8DIIBAHJn7ZQUm6PNcceqRgy3bw=
|
||||
gitea.maximumdirect.net/ejr/weatherfeeder v0.7.2 h1:GJdZ9x54HLTPidPGhD/dmq7efvGjBltK1ywCIRU1w6c=
|
||||
gitea.maximumdirect.net/ejr/weatherfeeder v0.7.2/go.mod h1:P7rP7XftJjBFzNEIkAiX+z2YqXOtnZjy3BaF6kX+sO4=
|
||||
github.com/lib/pq v1.10.9 h1:YXG7RB+JIjhP29X+OtkiDnYaXQwpS4JEWq7dtCCRUEw=
|
||||
github.com/lib/pq v1.10.9/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o=
|
||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
|
||||
|
||||
Reference in New Issue
Block a user