30 lines
946 B
Docker
30 lines
946 B
Docker
# Choosing the image to use
|
|
FROM node:buster
|
|
|
|
# Defining variables to allow flexibility (each variable can be set directly within our topology deployment script)
|
|
ENV local_ip=127.0.0.1
|
|
ENV local_port=8181
|
|
ENV local_name=gwi
|
|
ENV remote_ip=127.0.0.1
|
|
ENV remote_port=8080
|
|
ENV remote_name=srv
|
|
|
|
# Installing required libraries
|
|
RUN apt-get update && \
|
|
apt-get install -y net-tools iputils-ping && \
|
|
mkdir mydir && \
|
|
cd mydir && \
|
|
npm install express && \
|
|
npm install yargs && \
|
|
npm install systeminformation && \
|
|
npm install request && \
|
|
wget http://homepages.laas.fr/smedjiah/tmp/gateway.js
|
|
|
|
ENV LAUNCHER "node /mydir/gateway.js --local_ip '$local_ip' --local_port $local_port --local_name '$local_name' --remote_ip '$remote_ip' --remote_port $remote_port --remote_name '$remote_name'"
|
|
|
|
ENV VIM_EMU_CMD "nohup $LAUNCHER &"
|
|
#ENV VIM_EMU_CMD_STOP "TODO at shutdown"
|
|
|
|
# Mandatory entrypoint in containernet
|
|
CMD /bin/bash
|
|
|