zeus 4 years ago
parent
commit
947829e993
  1. 1
      Dockerfile
  2. 12
      startup.sh

1
Dockerfile

@ -7,6 +7,7 @@ LABEL MAINTAINERS="Guillaume Scheibel <guillaume.scheibel@gmail.com>, Damien DUP
# build/llo-base-images/asciidoctor-alpine/docker-asciidoctor # build/llo-base-images/asciidoctor-alpine/docker-asciidoctor
RUN apk add --no-cache \ RUN apk add --no-cache \
bash \ bash \
sudo \
curl \ curl \
ca-certificates \ ca-certificates \
findutils \ findutils \

12
startup.sh

@ -55,11 +55,14 @@ read -r -d '' VAR <<EOF
if [ ! -d "$REPO" ] ; then if [ ! -d "$REPO" ] ; then
cd /home/$USER cd /home/$USER
git clone $GIT_TUTOR git clone $GIT_TUTOR
chown -R $USER.$USER /home/$USER
else else
cd /home/$USER/$REPO cd /home/$USER/$REPO
git fetch origin master git fetch origin master
git reset --hard FETCH_HEAD git reset --hard FETCH_HEAD
git clean -df git clean -df
chown -R $USER.$USER /home/$USER
fi fi
@ -75,12 +78,10 @@ chmod +x /home/$USER/crond/playground-sync.sh
read -r -d '' VAR <<EOF read -r -d '' VAR <<EOF
#!/bin/bash #!/bin/bash
cd /home/$USER/$REPO/swarmlab-app/src sudo -H -u node /bin/bash -c 'cd /home/$USER/$REPO/swarmlab-app/src; npm install; npm cache clean --force;'
npm install;
npm cache clean --force;
EOF EOF
echo "$VAR" > /home/$USER/crond/playground-sync.sh echo "$VAR" > /home/$USER/crond/playground-npm-install.sh
@ -138,7 +139,8 @@ chown -R $USER.$USER /home/$USER
chmod -R 755 /home/$USER chmod -R 755 /home/$USER
/home/$USER/crond/playground-start.sh
/home/$USER/crond/playground-sync.sh /home/$USER/crond/playground-sync.sh
sudo -H -u node bash /home/$USER/crond/playground-npm-install.sh
/home/$USER/crond/playground-start.sh
/usr/bin/supervisord -n -c /etc/supervisor/supervisord.conf /usr/bin/supervisord -n -c /etc/supervisor/supervisord.conf

Loading…
Cancel
Save