-
Notifications
You must be signed in to change notification settings - Fork 23
/
Dockerfile
29 lines (21 loc) · 695 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
FROM golang:1.20-alpine as builder
# Move to working directory /build
WORKDIR /build
# Copy and download dependency using go mod
COPY go.mod .
COPY go.sum .
RUN go mod download
# Copy the code into the container
COPY . .
# Build the application
RUN go build -o main ./cmd/server
# Build the utility scripts
RUN go build ./cmd/invoice-republishing
RUN go build ./cmd/payment-reconciliation
# Start a new, final image to reduce size.
FROM alpine as final
# Copy the binaries and entrypoint from the builder image.
COPY --from=builder /build/main /bin/
COPY --from=builder /build/invoice-republishing /bin/
COPY --from=builder /build/payment-reconciliation /bin/
ENTRYPOINT [ "/bin/main" ]