Skip to content
Permalink
Browse files

Update Dockerfile

Fresh new Dockerfile based on node:8-alpine
  • Loading branch information...
etienne-napoleone committed Jun 22, 2018
1 parent bdc192e commit 3df2f22cacef993db0746f85bfd63faea6ed9cd9
Showing with 10 additions and 55 deletions.
  1. +10 −55 Dockerfile
@@ -1,61 +1,16 @@
## Dockerfile for eth-net-intelligence-api (build from git).
##
## Build via:
#
# `docker build -t ethnetintel:latest .`
#
## Run via:
#
# `docker run -v <path to app.json>:/home/ethnetintel/eth-net-intelligence-api/app.json ethnetintel:latest`
#
## Make sure, to mount your configured 'app.json' into the container at
## '/home/ethnetintel/eth-net-intelligence-api/app.json', e.g.
## '-v /path/to/app.json:/home/ethnetintel/eth-net-intelligence-api/app.json'
##
## Note: if you actually want to monitor a client, you'll need to make sure it can be reached from this container.
## The best way in my opinion is to start this container with all client '-p' port settings and then
# share its network with the client. This way you can redeploy the client at will and just leave 'ethnetintel' running. E.g. with
## the python client 'pyethapp':
##
#
# `docker run -d --name ethnetintel \
# -v /home/user/app.json:/home/ethnetintel/eth-net-intelligence-api/app.json \
# -p 0.0.0.0:30303:30303 \
# -p 0.0.0.0:30303:30303/udp \
# ethnetintel:latest`
#
# `docker run -d --name pyethapp \
# --net=container:ethnetintel \
# -v /path/to/data:/data \
# pyethapp:latest`
#
## If you now want to deploy a new client version, just redo the second step.
FROM node:8-alpine

LABEL maintainer="etienne@tomochain.com"

FROM debian
WORKDIR /eniapi

RUN apt-get update &&\
apt-get install -y curl git-core &&\
curl -sL https://deb.nodesource.com/setup | bash - &&\
apt-get update &&\
apt-get install -y nodejs
ENV WS_SECRET ''
ENV CONTACT_DETAILS ''
ENV INSTANCE_NAME 'unnamed node'

RUN apt-get update &&\
apt-get install -y build-essential
COPY . /eniapi

RUN adduser ethnetintel
RUN npm install -g pm2 && \
npm install

RUN cd /home/ethnetintel &&\
git clone https://github.com/cubedro/eth-net-intelligence-api &&\
cd eth-net-intelligence-api &&\
npm install &&\
npm install -g pm2

RUN echo '#!/bin/bash\nset -e\n\ncd /home/ethnetintel/eth-net-intelligence-api\n/usr/bin/pm2 start ./app.json\ntail -f \
/home/ethnetintel/.pm2/logs/node-app-out-0.log' > /home/ethnetintel/startscript.sh

RUN chmod +x /home/ethnetintel/startscript.sh &&\
chown -R ethnetintel. /home/ethnetintel

USER ethnetintel
ENTRYPOINT ["/home/ethnetintel/startscript.sh"]
ENTRYPOINT ["pm2", "start", "--no-daemon", "app.json"]

0 comments on commit 3df2f22

Please sign in to comment.
You can’t perform that action at this time.