Bugfix to accommodate private upstream repository for feedapi
Some checks failed
ci/woodpecker/push/build-image Pipeline failed

This commit is contained in:
2026-03-19 20:58:01 -05:00
parent e7a9893824
commit 56f96c4a7a
3 changed files with 10 additions and 10 deletions

View File

@@ -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"]