2023-10-13 11:48:14 +02:00
|
|
|
# Builder image
|
|
|
|
|
FROM --platform=linux/amd64 golang:1.21 as builder
|
|
|
|
|
|
|
|
|
|
WORKDIR /src
|
|
|
|
|
|
|
|
|
|
COPY go.mod go.sum ./
|
|
|
|
|
RUN go mod download
|
|
|
|
|
|
|
|
|
|
COPY . .
|
|
|
|
|
RUN go build -mod=readonly -v -o pactual-backend main.go
|
|
|
|
|
|
|
|
|
|
# Runtime image
|
|
|
|
|
FROM --platform=linux/amd64 golang:1.21
|
|
|
|
|
|
|
|
|
|
WORKDIR /app
|
|
|
|
|
|
2023-11-14 10:24:25 +01:00
|
|
|
# Copy the binary from the builder stage
|
2023-10-13 11:48:14 +02:00
|
|
|
COPY --from=builder /src/pactual-backend .
|
2023-11-14 10:24:25 +01:00
|
|
|
|
|
|
|
|
# Copy the app/views/qor folder
|
2023-11-14 11:47:44 +01:00
|
|
|
COPY app/views/qor /app/app/views/qor
|
2023-11-14 10:24:25 +01:00
|
|
|
|
2023-10-13 11:48:14 +02:00
|
|
|
CMD ["/app/pactual-backend"]
|