forked from deso-protocol/backend
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
43 lines (31 loc) · 925 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
FROM alpine:latest AS backend
RUN apk update
RUN apk upgrade
RUN apk add --update go gcc g++ vips-dev
WORKDIR /deso/src
COPY backend/go.mod backend/
COPY backend/go.sum backend/
COPY core/go.mod core/
COPY core/go.sum core/
WORKDIR /deso/src/backend
RUN go mod download
# include backend src
COPY backend/apis apis
COPY backend/config config
COPY backend/cmd cmd
COPY backend/miner miner
COPY backend/routes routes
COPY backend/countries countries
COPY backend/main.go .
# include core src
COPY core/desohash ../core/desohash
COPY core/cmd ../core/cmd
COPY core/lib ../core/lib
COPY core/migrate ../core/migrate
# build backend
RUN GOOS=linux go build -mod=mod -a -installsuffix cgo -o bin/backend main.go
# create tiny image
FROM alpine:latest
RUN apk add --update vips-dev
COPY --from=backend /deso/src/backend/bin/backend /deso/bin/backend
ENTRYPOINT ["/deso/bin/backend"]