forked from deso-protocol/backend
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
38 lines (27 loc) · 821 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
FROM alpine:edge AS backend
RUN apk update
RUN apk upgrade
RUN apk add --update go=1.16.4-r0 gcc g++ vips-dev
WORKDIR /bitclout/src
COPY backend/go.mod backend/
COPY backend/go.sum backend/
COPY core/go.mod core/
COPY core/go.sum core/
COPY core/third_party/ core/third_party/
WORKDIR /bitclout/src/backend
RUN go mod download
# include backend src
COPY backend/cmd cmd
COPY backend/miner miner
COPY backend/routes routes
COPY backend/main.go .
# include core src
COPY core/clouthash ../core/clouthash
COPY core/cmd ../core/cmd
COPY core/lib ../core/lib
# build backend
RUN GOOS=linux go build -mod=mod -a -installsuffix cgo -o bin/backend main.go
# create tiny image
FROM alpine:edge
RUN apk add --update vips-dev
COPY --from=backend /bitclout/src/backend/bin/backend /bitclout/bin/backend