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.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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 images /usr/local/apache2/htdocs/images
  25. COPY design /usr/local/apache2/htdocs/design
  26. COPY theme /home/venus/theme
  27. COPY lang /home/venus/lang
  28. COPY bin /home/venus/bin
  29. RUN touch /home/venus/planet.log
  30. # Set correct permissions
  31. RUN chown -R venus:venus /usr/local/apache2/htdocs /home/venus/
  32. # Switch to non-privileged user
  33. USER venus
  34. # Link EN as the default page
  35. WORKDIR /usr/local/apache2/htdocs/
  36. RUN ln -s en/atom.xml en/foafroll.xml en/index.html en/opml.xml en/rss20.xml .
  37. # Ugly hack to break caching from here on
  38. ADD https://status.fsfe.org/fsfe.org/ /dev/null
  39. # Initially run all planets
  40. RUN find /home/venus/lang/ -name "planet_*.ini" -exec planet {} \;
  41. # Switch back to root and run cron+Apache
  42. USER root
  43. CMD httpd -DFOREGROUND & cron && : >> /home/venus/planet.log && tail -f /home/venus/planet.log