new Dockerfile; test

This commit is contained in:
Leo Maroni 2018-05-19 14:01:43 +02:00
parent 072e8f42a2
commit 69f4fa0fb9
No known key found for this signature in database
GPG Key ID: D1C3D579B60CB591
2 changed files with 4 additions and 4 deletions

View File

@ -7,7 +7,7 @@ WORKDIR /project
RUN apt-get update -y && apt-get install -y git ruby ruby-dev rubygems build-essential cron RUN apt-get update -y && apt-get install -y git ruby ruby-dev rubygems build-essential cron
RUN gem install bundle RUN gem install bundle
RUN git init && git remote add origin https://gitlab.com/labcode-de/ffrs-website.git RUN git init && git remote add origin https://gitlab.com/labcode-de/ffrs-website.git
RUN touch /etc/cron.d/update && touch /srv/update.sh && chmod 775 /srv/update.sh && chmod 644 /etc/cron.d/update RUN touch /etc/cron.d/update && touch /srv/update.sh && chmod 775 /srv/update.sh && chmod 644 /etc/cron.d/update && touch /var/log/cron.log
RUN echo "git pull origin v2 && bundle exec jekyll build && rm -rf /usr/share/nginx/html/* && cp -r _site/* /usr/share/nginx/html" > /srv/update.sh RUN echo "cd /project && git pull origin v2 && /usr/local/bin/bundle exec jekyll build && rm -rf /usr/share/nginx/html/* && cp -r _site/* /usr/share/nginx/html" > /srv/update.sh
RUN echo "*/1 * * * * /srv/update.sh" > /etc/cron.d/update RUN echo "*/1 * * * * root /srv/update.sh >> /var/log/cron.log 2>&1" > /etc/cron.d/update
CMD git fetch && git pull origin v2 && bundle install && bundle exec jekyll build && rm -rf /usr/share/nginx/html/* && cp -r _site/* /usr/share/nginx/html && echo "ready" && nginx -g "daemon off;" && /etc/init.d/cron start CMD git fetch && git pull origin v2 && bundle install && bundle exec jekyll build && rm -rf /usr/share/nginx/html/* && cp -r _site/* /usr/share/nginx/html && echo "ready" && /etc/init.d/cron start && nginx -g "daemon off;"