updated dockerfile
This commit is contained in:
@@ -15,12 +15,15 @@ ARG GIT_COMMIT=unknown
|
|||||||
WORKDIR /build
|
WORKDIR /build
|
||||||
|
|
||||||
# Cache dependencies first
|
# Cache dependencies first
|
||||||
COPY go.mod go.sum ./
|
COPY go.mod ./
|
||||||
RUN go mod download
|
RUN go mod download || true
|
||||||
|
|
||||||
# Copy source
|
# Copy source
|
||||||
COPY . .
|
COPY . .
|
||||||
|
|
||||||
|
# Generate go.sum and ensure all deps are fetched
|
||||||
|
RUN go mod tidy
|
||||||
|
|
||||||
# Build static binary
|
# Build static binary
|
||||||
RUN CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build \
|
RUN CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build \
|
||||||
-ldflags="-s -w \
|
-ldflags="-s -w \
|
||||||
@@ -78,4 +81,4 @@ HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \
|
|||||||
EXPOSE 8080
|
EXPOSE 8080
|
||||||
|
|
||||||
ENTRYPOINT ["/usr/local/bin/felhom-controller"]
|
ENTRYPOINT ["/usr/local/bin/felhom-controller"]
|
||||||
CMD ["--config", "/opt/docker/felhom-controller/controller.yaml"]
|
CMD ["--config", "/opt/docker/felhom-controller/controller.yaml"]
|
||||||
Reference in New Issue
Block a user