mirror of
https://github.com/grassrootseconomics/cic-chain-events.git
synced 2024-12-22 19:57:31 +01:00
Mohammed Sohail
2bbc05bb45
* This is a major refactor and includes general improvements around - context cancellation - build settings - jetstream pub sub - logging - docker builds - conf loading
34 lines
588 B
Docker
34 lines
588 B
Docker
FROM golang:1-bullseye as build
|
|
|
|
ENV CGO_ENABLED=1
|
|
ENV GOOS=linux
|
|
ENV GOARCH=amd64
|
|
|
|
ENV BUILD_COMMIT=${BUILD_COMMIT}
|
|
|
|
WORKDIR /build
|
|
|
|
COPY go.* .
|
|
RUN go mod download
|
|
|
|
COPY . .
|
|
RUN go build -o cic-chain-events -ldflags="-X main.build=${BUILD_COMMIT} -s -w" cmd/service/*
|
|
|
|
|
|
FROM debian:bullseye-slim
|
|
|
|
ENV DEBIAN_FRONTEND=noninteractive
|
|
|
|
WORKDIR /service
|
|
|
|
COPY --from=build /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
|
|
COPY --from=build /build/cic-chain-events .
|
|
COPY migrations migrations/
|
|
COPY config.toml .
|
|
COPY queries.sql .
|
|
COPY LICENSE .
|
|
|
|
EXPOSE 5000
|
|
|
|
CMD ["./cic-chain-events"]
|