forked from iotaledger/goshimmer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
37 lines (26 loc) · 814 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
# we need to use alpine to build since cgo is required
FROM golang:1.13-alpine AS build
RUN apk add --no-cache git gcc g++
# Set the current Working Directory inside the container
RUN mkdir /goshimmer
WORKDIR /goshimmer
# Download dependencies
COPY go.mod .
COPY go.sum .
RUN go mod download
# Copy everything from the current directory to the PWD(Present Working Directory) inside the container
COPY . .
# Build
RUN CGO_ENABLED=1 GOOS=linux go build -o /go/bin/goshimmer
FROM alpine:latest
RUN apk --no-cache add ca-certificates
WORKDIR /app
VOLUME /app/mainnetdb
EXPOSE 14666/tcp
EXPOSE 14626/udp
EXPOSE 14626/tcp
# Copy the Pre-built binary file from the previous stage
COPY --from=build /go/bin/goshimmer .
# Copy the docker config
COPY docker.config.json config.json
ENTRYPOINT ["./goshimmer"]