-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
53 lines (35 loc) · 1013 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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
FROM golang:alpine as builder
ARG APP=/forkdetector
ARG VER="v0.0.0-docker"
WORKDIR ${APP}
RUN apk add --no-cache make
ENV CGO_ENABLED=0
ENV GOOS=linux
ENV GOARCH=amd64
COPY go.mod .
COPY go.sum .
RUN go mod download
COPY *.go .
COPY api api
COPY chains chains
COPY loading loading
COPY peers peers
COPY version version
RUN go build -o build/bin/linux-amd64/forkdetector -ldflags="-X github.com/alexeykiselev/waves-fork-detector/version.version=${VER}" .
FROM alpine:latest
ARG APP=/forkdetector
ENV TZ=Etc/UTC
ENV APP_USER=forkdetector
ENV LOG_LEVEL=info
ENV CHAIN=mainnet
ENV DECLARED=0
STOPSIGNAL SIGINT
RUN addgroup -S $APP_USER && adduser -S $APP_USER -G $APP_USER
RUN apk add --no-cache bind-tools
USER $APP_USER
WORKDIR ${APP}
EXPOSE 8080
EXPOSE 6868
VOLUME /fd
COPY --from=builder ${APP}/build/bin/linux-amd64/forkdetector ${APP}/forkdetector
ENTRYPOINT ./forkdetector -db /fd -log-level $LOG_LEVEL -blockchain-type $CHAIN -declared-address $DECLARED -api 0.0.0.0:8080 -net 0.0.0.0:6868