cic-custodial/Dockerfile

34 lines
579 B
Docker
Raw Permalink Normal View History

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}
WORKDIR /build
2023-03-08 11:02:56 +01:00
COPY go.* .
RUN go mod download
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/*
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/
COPY --from=build /build/cic-custodial .
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 .
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"]