Files
neural-hunt/Dockerfile.customer-service
jbergner bcfbef390f
Some checks failed
release-tag / release-image (push) Failing after 2m44s
RC-7
2026-08-11 16:58:07 +02:00

27 lines
710 B
Docker

FROM golang:1.23-alpine AS build
WORKDIR /src
# Resolve dependencies before copying source. Do not run `go mod tidy` here.
COPY go.mod go.sum ./
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-customer-service ./cmd/customer-service
FROM alpine:3.21
RUN adduser -D -h /home/app app \
&& mkdir -p /app /customer-data \
&& chown -R app:app /app /customer-data
WORKDIR /app
COPY --from=build /out/neuralhunt-customer-service /app/neuralhunt-customer-service
USER app
ENV CUSTOMER_SQLITE_PATH=/customer-data/customer-service.db
EXPOSE 8090 8091 8092
ENTRYPOINT ["/app/neuralhunt-customer-service"]