FROM golang:1.26-alpine AS build WORKDIR /src COPY go.mod ./ RUN go mod download COPY cmd ./cmd COPY internal ./internal 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 WORKDIR /app COPY --from=build /out/neuralhunt /app/neuralhunt COPY --from=build /out/neuralhunt-client /app/neuralhunt-client USER app ENV SQLITE_PATH=/data/neuralhunt.db \ ARTIFACT_DIR=/data/artifacts EXPOSE 8080 ENTRYPOINT ["/app/neuralhunt"]