Merge pull request #1 from thunderstorm99/patch-1

Update Dockerfile
This commit is contained in:
Leo Maroni 2018-10-24 10:38:36 +02:00 committed by GitHub
commit 753bfd41db
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2,7 +2,6 @@ FROM nginx:1
MAINTAINER Freifunk Rhein-Sieg e.V. <technik@freifunk-rhein-sieg.net> MAINTAINER Freifunk Rhein-Sieg e.V. <technik@freifunk-rhein-sieg.net>
EXPOSE 80 EXPOSE 80
RUN mkdir -p /project/
WORKDIR /project 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
@ -10,4 +9,4 @@ RUN git init && git remote add origin https://github.com/Freifunk-Rhein-Sieg/fre
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 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 "cd /project && git pull origin master && /usr/local/bin/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 master && /usr/local/bin/jekyll build && rm -rf /usr/share/nginx/html/* && cp -r _site/* /usr/share/nginx/html" > /srv/update.sh
RUN echo "*/30 * * * * root /srv/update.sh >> /var/log/cron.log 2>&1" > /etc/cron.d/update RUN echo "*/30 * * * * root /srv/update.sh >> /var/log/cron.log 2>&1" > /etc/cron.d/update
CMD git fetch && git pull origin master && 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;" ENTRYPOINT git fetch && git pull origin master && 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;"