Fixed up the .gitignore

More push to move towards a deployment stage
This commit is contained in:
2025-08-21 20:57:23 -04:00
parent 9502d1b1be
commit e2651456da
12 changed files with 379 additions and 265 deletions

View File

@@ -9,21 +9,14 @@ ARG TARGETARCH
ARG TARGETVARIANT
WORKDIR /src
# 1) Copy ONLY go.mod first and materialize go.sum inside the image
COPY go.mod ./
# Produce go.sum (and module cache) before copying the rest
RUN --mount=type=cache,target=/root/.cache/go-build \
go mod download && go mod verify
# 2) Now copy the rest of the source
# Copy the rest and tidy (creates go.sum if missing)
COPY . .
RUN --mount=type=cache,target=/root/.cache/go-build go mod tidy
# (Optional but nice) ensure module graph is tidy (updates go.sum if needed)
RUN --mount=type=cache,target=/root/.cache/go-build \
go mod tidy
# 3) Build (with ARM variant handling)
ENV CGO_ENABLED=0
RUN --mount=type=cache,target=/root/.cache/go-build \
if [ "${TARGETARCH}${TARGETVARIANT}" = "armv6" ]; then export GOARM=6; fi && \
@@ -38,7 +31,8 @@ FROM gcr.io/distroless/base-debian12:nonroot
WORKDIR /app
COPY --from=build /out/greencoast-shard /app/greencoast-shard
COPY configs/shard.sample.yaml /app/shard.yaml
COPY client /app/client
VOLUME ["/var/lib/greencoast"]
EXPOSE 8080 8081
EXPOSE 8080 8081 8443 9443
USER nonroot:nonroot
ENTRYPOINT ["/app/greencoast-shard","--config","/app/shard.yaml"]