2023-03-01 12:19:57 +01:00
|
|
|
FROM golang:1-bullseye as build
|
2023-03-08 11:02:56 +01:00
|
|
|
|
|
|
|
ENV CGO_ENABLED=1
|
|
|
|
ENV GOOS=linux
|
|
|
|
ENV GOARCH=amd64
|
|
|
|
|
|
|
|
ENV BUILD_COMMIT=${BUILD_COMMIT}
|
|
|
|
|
2022-12-01 10:19:47 +01:00
|
|
|
WORKDIR /build
|
2023-03-08 11:02:56 +01:00
|
|
|
|
|
|
|
COPY go.* .
|
|
|
|
RUN go mod download
|
|
|
|
|
2022-12-01 10:19:47 +01:00
|
|
|
COPY . .
|
2023-03-08 11:02:56 +01:00
|
|
|
RUN go build -o cic-custodial -ldflags="-X main.build=${BUILD_COMMIT} -s -w" cmd/service/*
|
2022-12-01 10:19:47 +01:00
|
|
|
|
2023-03-08 15:19:33 +01:00
|
|
|
|
2022-12-01 10:19:47 +01:00
|
|
|
FROM debian:bullseye-slim
|
2023-03-08 11:02:56 +01:00
|
|
|
|
2022-12-01 09:09:46 +01:00
|
|
|
ENV DEBIAN_FRONTEND=noninteractive
|
2023-03-08 11:02:56 +01:00
|
|
|
|
2022-12-01 09:09:46 +01:00
|
|
|
WORKDIR /service
|
2023-03-08 11:02:56 +01:00
|
|
|
|
|
|
|
COPY --from=build /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
|
2022-12-01 10:19:47 +01:00
|
|
|
COPY --from=build /build/cic-custodial .
|
2023-03-01 12:19:57 +01:00
|
|
|
COPY migrations migrations/
|
2022-11-30 10:51:24 +01:00
|
|
|
COPY config.toml .
|
2023-02-28 11:37:30 +01:00
|
|
|
COPY queries.sql .
|
2023-03-08 15:19:33 +01:00
|
|
|
COPY LICENSE .
|
2023-03-08 11:02:56 +01:00
|
|
|
|
2022-11-30 10:51:24 +01:00
|
|
|
EXPOSE 5000
|
2023-03-08 11:02:56 +01:00
|
|
|
|
|
|
|
CMD ["./cic-custodial"]
|