cic-chain-events/Dockerfile

34 lines
588 B
Docker
Raw Normal View History

FROM golang:1-bullseye as build
ENV CGO_ENABLED=1
ENV GOOS=linux
ENV GOARCH=amd64
ENV BUILD_COMMIT=${BUILD_COMMIT}
2023-01-06 09:07:19 +01:00
2023-01-06 12:45:33 +01:00
WORKDIR /build
COPY go.* .
RUN go mod download
2023-01-06 12:45:33 +01:00
COPY . .
RUN go build -o cic-chain-events -ldflags="-X main.build=${BUILD_COMMIT} -s -w" cmd/service/*
2023-01-06 09:07:19 +01:00
2023-01-06 12:45:33 +01:00
FROM debian:bullseye-slim
2023-01-06 09:07:19 +01:00
2023-01-06 12:45:33 +01:00
ENV DEBIAN_FRONTEND=noninteractive
WORKDIR /service
COPY --from=build /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
2023-01-06 12:45:33 +01:00
COPY --from=build /build/cic-chain-events .
COPY migrations migrations/
2023-01-06 09:07:19 +01:00
COPY config.toml .
COPY queries.sql .
COPY LICENSE .
EXPOSE 5000
2023-01-06 12:45:33 +01:00
CMD ["./cic-chain-events"]