2018-05-08 16:35:40 +00:00
|
|
|
FROM nginx:1
|
|
|
|
MAINTAINER Freifunk Rhein-Sieg e.V. <technik@freifunk-rhein-sieg.net>
|
|
|
|
EXPOSE 80
|
|
|
|
|
|
|
|
RUN mkdir -p /project/
|
|
|
|
WORKDIR /project
|
2018-05-17 17:58:44 +00:00
|
|
|
RUN apt-get update -y && apt-get install -y git ruby ruby-dev rubygems build-essential cron
|
2018-05-08 16:35:40 +00:00
|
|
|
RUN gem install bundle
|
2018-05-17 17:58:44 +00:00
|
|
|
RUN git init && git remote add origin https://gitlab.com/labcode-de/ffrs-website.git
|
2018-05-19 12:01:43 +00:00
|
|
|
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 v2 && /usr/local/bin/bundle exec jekyll build && rm -rf /usr/share/nginx/html/* && cp -r _site/* /usr/share/nginx/html" > /srv/update.sh
|
2018-05-19 12:30:40 +00:00
|
|
|
RUN echo "*/30s * * * * root /srv/update.sh >> /var/log/cron.log 2>&1" > /etc/cron.d/update
|
2018-05-19 12:01:43 +00:00
|
|
|
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;"
|