forked from skycoin/skycoin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
51 lines (34 loc) · 1.06 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
# skycoin build binaries
# reference https://github.com/skycoin/skycoin
FROM golang:1.9-alpine AS build-go
COPY . $GOPATH/src/github.com/skycoin/skycoin
RUN cd $GOPATH/src/github.com/skycoin/skycoin && \
CGO_ENABLED=0 GOOS=linux go install -a -installsuffix cgo ./...
# skycoin gui
FROM node:8.9 AS build-node
COPY . /skycoin
# `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 /skycoin/src/gui/static && \
yarn && \
npm run build
# skycoin image
FROM alpine:3.7
ENV COIN="skycoin" \
RPC_ADDR="0.0.0.0:6430" \
DATA_DIR="/data/.$COIN" \
WALLET_DIR="/wallet" \
WALLET_NAME="$COIN_cli.wlt"
RUN adduser -D skycoin
USER skycoin
# copy binaries
COPY --from=build-go /go/bin/* /usr/bin/
# copy gui
COPY --from=build-node /skycoin/src/gui/static /usr/local/skycoin/src/gui/static
# volumes
VOLUME $WALLET_DIR
VOLUME $DATA_DIR
EXPOSE 6000 6420 6430
WORKDIR /usr/local/skycoin
CMD ["skycoin", "--web-interface-addr=0.0.0.0"]