2023-07-06 11:29:06 +00:00
|
|
|
### STAGE 1.a: Prepare certs ###
|
|
|
|
FROM alpine:latest as certs
|
|
|
|
RUN apk --update add ca-certificates
|
|
|
|
|
|
|
|
### STAGE 1.b: Build ###
|
|
|
|
FROM golang as go-build
|
|
|
|
WORKDIR /root
|
|
|
|
COPY go.mod go.sum ./
|
|
|
|
# install packages
|
|
|
|
RUN go mod download
|
|
|
|
COPY . .
|
|
|
|
ENV CGO_ENABLED=0
|
2023-07-10 08:10:13 +00:00
|
|
|
RUN go build -tags timetzdata payment-poc
|
2023-07-06 11:29:06 +00:00
|
|
|
|
|
|
|
### Stage 2: Run ###
|
|
|
|
FROM scratch
|
2023-07-10 08:10:13 +00:00
|
|
|
WORKDIR /
|
2023-07-06 11:29:06 +00:00
|
|
|
COPY --from=certs /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
|
2023-07-10 08:10:13 +00:00
|
|
|
COPY --from=go-build /root/payment-poc /usr/bin/payment-poc
|
|
|
|
ADD templates /templates
|
|
|
|
ENTRYPOINT ["payment-poc"]
|