zeus 4 years ago
parent
commit
f232ddbc89
  1. 2
      Dockerfile
  2. 3
      startup.sh
  3. 8
      supervisord-iot.conf

2
Dockerfile

@ -63,7 +63,7 @@ RUN mkdir -p /home/node/log \
&& mkdir -p /home/node/crond \ && mkdir -p /home/node/crond \
&& mkdir -p /home/node/run \ && mkdir -p /home/node/run \
&& mkdir -p /run/nginx \ && mkdir -p /run/nginx \
&& npm install pm2@latest -g \ && npm install pm2@latest express -g \
&& chmod -R 755 /home/node \ && chmod -R 755 /home/node \
&& chmod +x /usr/local/bin/mpi_bootstrap \ && chmod +x /usr/local/bin/mpi_bootstrap \
&& chmod +x /home/node/startup.sh \ && chmod +x /home/node/startup.sh \

3
startup.sh

@ -78,7 +78,8 @@ chmod +x /home/$USER/crond/playground-sync.sh
read -r -d '' VAR <<EOF read -r -d '' VAR <<EOF
#!/bin/bash #!/bin/bash
su -c 'cd /home/$USER/$REPO/swarmlab-app/src; npm install; npm install express; npm cache clean --force;' - node su -c 'cd /home/$USER/$REPO/swarmlab-app/src; npm install; npm cache clean --force;' - node
su -c 'pm2-runtime /home/$USER/crond/playground.config.js' - node
EOF EOF

8
supervisord-iot.conf

@ -5,10 +5,10 @@ command=bash -c "sleep 5 && cd /home/node && su -c 'ttyd --ssl --ssl-cert /home/
stdout_logfile=/var/log/ttyd.log stdout_logfile=/var/log/ttyd.log
autorestart=true autorestart=true
[program:pm2] #[program:pm2]
command=bash -c 'sleep 5 && pm2-runtime /home/%(ENV_USER)s/crond/playground.config.js ' #command=bash -c 'sleep 5 && pm2-runtime /home/%(ENV_USER)s/crond/playground.config.js '
stdout_logfile=/var/log/pm2.log #stdout_logfile=/var/log/pm2.log
autorestart=true #autorestart=true
[program:nginx] [program:nginx]

Loading…
Cancel
Save