RC-3-B
Some checks failed
release-tag / release-image (push) Failing after 1m22s

This commit is contained in:
2026-08-10 06:39:51 +02:00
parent 417b1e4e0e
commit 8e86ea74e4

View File

@@ -1,12 +1,22 @@
FROM golang:1.26-alpine AS build
WORKDIR /src
COPY go.* ./
# Keep dependency resolution deterministic. Do NOT run `go mod tidy` before
# source files are present: it can remove required modules because no packages
# are visible yet.
COPY go.mod go.sum ./
RUN go mod download
RUN go mod tidy
COPY cmd ./cmd
COPY internal ./internal
RUN CGO_ENABLED=0 GOOS=linux go build -trimpath -ldflags="-s -w" -o /out/neuralhunt ./cmd/server
RUN CGO_ENABLED=0 GOOS=linux go build -trimpath -ldflags="-s -w" -o /out/neuralhunt-client ./cmd/client
# Fail early with a useful message if a repository/.dockerignore rule ever
# drops the application's internal data package from the build context.
RUN test -f /src/internal/data/store.go \
&& test -f /src/internal/data/schema.sql
RUN CGO_ENABLED=0 GOOS=linux go build -trimpath -ldflags="-s -w" -o /out/neuralhunt ./cmd/server \
&& CGO_ENABLED=0 GOOS=linux go build -trimpath -ldflags="-s -w" -o /out/neuralhunt-client ./cmd/client
FROM alpine:3.24
RUN adduser -D -H app && mkdir -p /data /app && chown -R app:app /data /app