forked from MDLlife/MDL
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
51 lines (34 loc) · 1 KB
/
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
# MDL build binaries
# reference https://github.com/MDLLife/MDL
FROM golang:1.9-alpine AS build-go
COPY . $GOPATH/src/github.com/MDLLife/MDL
RUN cd $GOPATH/src/github.com/MDLLife/MDL && \
CGO_ENABLED=0 GOOS=linux go install -a -installsuffix cgo ./...
# mdl gui
FROM node:8.9 AS build-node
COPY . /mdl
# `unsafe` flag used as work around to prevent infinite loop in Docker
# see https://github.com/nodejs/node-gyp/issues/1236
RUN npm install -g --unsafe @angular/cli && \
cd /mldl/src/gui/static && \
yarn && \
npm run build
# mdl image
FROM alpine:3.7
ENV COIN="mdl" \
RPC_ADDR="0.0.0.0:8330" \
DATA_DIR="/data/.$COIN" \
WALLET_DIR="/wallet" \
WALLET_NAME="$COIN_cli.wlt"
RUN adduser -D mdl
USER mdl
# copy binaries
COPY --from=build-go /go/bin/* /usr/bin/
# copy gui
COPY --from=build-node /mdl/src/gui/static /usr/local/mdl/src/gui/static
# volumes
VOLUME $WALLET_DIR
VOLUME $DATA_DIR
EXPOSE 6000 8320 8330
WORKDIR /usr/local/mdl
CMD ["mdl", "--web-interface-addr=0.0.0.0"]