forked from trufflesuite/ganache-cli-archive
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
45 lines (37 loc) · 1.47 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
FROM mhart/alpine-node:10 as builder
LABEL org.opencontainers.image.source https://github.com/clearmatics/ganache-cli
RUN apk --update --no-cache add \
make \
gcc \
g++ \
python \
git \
bash \
cmake \
libressl-dev \
gmp-dev \
procps-dev \
rsync
WORKDIR /app
COPY . .
# See: https://github.com/npm/npm/issues/17346
# and https://stackoverflow.com/a/52767310
RUN npm config set unsafe-perm true && npm install
RUN npx webpack-cli --config ./webpack/webpack.docker.config.js
## TODO: Uncomment and fix the lines below to have a more efficient
## multi-stage build (to shrink the image size)
#FROM mhart/alpine-node:10 as runtime
#
#WORKDIR /app
#
#COPY --from=builder "/app/node_modules/scrypt/build/Release" "./node_modules/scrypt/build/Release/"
#COPY --from=builder "/app/node_modules/sha3/build/Release" "./node_modules/sha3/build/Release/"
#COPY --from=builder "/app/node_modules/ganache-core/node_modules/websocket/build/Release" "./node_modules/ganache-core/node_modules/websocket/build/Release/"
#COPY --from=builder "/app/build/ganache-core.docker.cli.js" "./ganache-core.docker.cli.js"
#COPY --from=builder "/app/build/ganache-core.docker.cli.js.map" "./ganache-core.docker.cli.js.map"
# Set the docker environment to listen on 0.0.0.0
# https://github.com/clearmatics/ganache-cli/blob/v6.10.1-clearmatics/args.js#L15
ENV DOCKER true
EXPOSE 8545
# Further flags can be passed when starting the container (see README.md)
ENTRYPOINT ["node", "cli.js"]