The FSFE planet, a blog aggregator of posts from our community https://planet.fsfe.org
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Dockerfile 1.9KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. FROM httpd:2.4
  2. ENV DEBIAN_FRONTEND=noninteractive LANG=en_US.UTF-8 LC_ALL=C.UTF-8 LANGUAGE=en_US.UTF-8
  3. # Set apt sources and preferences
  4. RUN mv /etc/apt/sources.list /etc/apt/sources.list.d/stable.list
  5. RUN sed "s/stretch/testing/g" /etc/apt/sources.list.d/stable.list > /etc/apt/sources.list.d/testing.list
  6. COPY preferences.d/* /etc/apt/preferences.d/
  7. # update and install packages
  8. RUN apt-get -q update && \
  9. apt-get -qy --allow-downgrades --allow-remove-essential --allow-change-held-packages upgrade && \
  10. apt-get install -y planet-venus/testing procps cron && \
  11. apt clean && \
  12. rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
  13. # Add venus user
  14. RUN adduser --quiet --disabled-password --shell /bin/bash --home /home/venus --gecos "User" venus
  15. # Enable cron
  16. ADD cron.txt /etc/cron.d/planet
  17. RUN chmod 0644 /etc/cron.d/planet
  18. # Clean default Apache sites
  19. RUN rm -rf /usr/local/apache2/htdocs/*
  20. # Copy Apache config
  21. COPY httpd.conf /usr/local/apache2/conf/httpd.conf
  22. # Copy directories
  23. COPY faces /usr/local/apache2/htdocs/faces
  24. COPY graphics /usr/local/apache2/htdocs/graphics
  25. COPY look /usr/local/apache2/htdocs/look
  26. COPY fonts /usr/local/apache2/htdocs/fonts
  27. COPY theme /home/venus/theme
  28. COPY lang /home/venus/lang
  29. COPY bin /home/venus/bin
  30. RUN touch /home/venus/planet.log
  31. # Set correct permissions
  32. RUN chown -R venus:venus /usr/local/apache2/htdocs /home/venus/
  33. # Switch to non-privileged user
  34. USER venus
  35. # Link EN as the default page
  36. WORKDIR /usr/local/apache2/htdocs/
  37. RUN ln -s en/atom.xml en/foafroll.xml en/index.html en/opml.xml en/rss20.xml .
  38. # Ugly hack to break caching from here on
  39. ADD https://status.fsfe.org/fsfe.org/ /dev/null
  40. # Initially run all planets
  41. RUN find /home/venus/lang/ -name "planet_*.ini" -exec planet {} \;
  42. # Switch back to root and run cron+Apache
  43. USER root
  44. CMD httpd -DFOREGROUND & cron && : >> /home/venus/planet.log && tail -f /home/venus/planet.log