summaryrefslogtreecommitdiff
path: root/Dockerfile
blob: 6b9c1bf07eaa624c2380fee9a4c3144bbb4bfccd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
FROM golang:1.26-alpine AS build

WORKDIR /src
COPY go.mod ./
COPY go.sum ./
RUN go mod download
COPY cmd ./cmd
COPY internal ./internal
RUN CGO_ENABLED=0 go build -buildvcs=false -trimpath -ldflags="-s -w" -o /out/aigw ./cmd/aigw && \
	CGO_ENABLED=0 go build -buildvcs=false -trimpath -ldflags="-s -w" -o /out/mockupstream ./cmd/mockupstream && \
	CGO_ENABLED=0 go build -buildvcs=false -trimpath -ldflags="-s -w" -o /out/stripe-preflight ./cmd/stripe-preflight

FROM build AS test
CMD ["go", "test", "./..."]

FROM alpine:3.22
RUN apk add --no-cache ca-certificates && adduser -D -H -u 10001 aigw
USER aigw
COPY --from=build /out/aigw /usr/local/bin/aigw
COPY --from=build /out/mockupstream /usr/local/bin/mockupstream
COPY --from=build /out/stripe-preflight /usr/local/bin/stripe-preflight
EXPOSE 8080 8081 8082 9090
ENTRYPOINT ["/usr/local/bin/aigw"]
CMD ["-config", "/etc/aigw/config.json"]