-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathDockerfile
34 lines (22 loc) · 995 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# first image used to build the sources
FROM golang:1.18-buster AS builder
ARG VERSION
ARG COMMIT
ARG DATE
ARG TARGETOS
ARG TARGETARCH
ENV GO111MODULE=on \
CGO_ENABLED=1
WORKDIR /neutrino-elements
COPY . .
RUN go mod download
RUN GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build -ldflags="-s -X 'main.version=${VERSION}' -X 'main.commit=${COMMIT}' -X 'main.date=${DATE}'" -o ./bin/neutrinod cmd/neutrinod/main.go
RUN GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build -ldflags="-s -X 'main.version=${VERSION}' -X 'main.commit=${COMMIT}' -X 'main.date=${DATE}'" -o ./bin/neutrino cmd/neutrino/*
# Second image, running the towerd executable
FROM debian:buster-slim
ENV NEUTRINO_ELEMENTS_DB_MIGRATION_PATH="file://"
RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates
WORKDIR /app
COPY --from=builder /neutrino-elements/bin/* /usr/local/bin/
COPY --from=builder /neutrino-elements/internal/infrastructure/storage/db/pg/migration/* .
ENTRYPOINT ["neutrinod"]