Dockerfile 3.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. #
  2. # Dockerized http://mediagoblin.org/
  3. # Copyright (C) Loic Dachary <loic@dachary.org>
  4. #
  5. # This program is free software: you can redistribute it and/or modify
  6. # it under the terms of the GNU Affero General Public License as published
  7. # by the Free Software Foundation, either version 3 of the License, or
  8. # (at your option) any later version.
  9. #
  10. # This program is distributed in the hope that it will be useful,
  11. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. # GNU Affero General Public License for more details.
  14. #
  15. # You should have received a copy of the GNU Affero General Public License
  16. # along with this program. If not, see <http://www.gnu.org/licenses/>.
  17. #
  18. FROM debian:jessie
  19. RUN apt-get update
  20. RUN apt-get install -y git-core python python-dev python-lxml python-imaging python-virtualenv npm nodejs-legacy automake nginx
  21. RUN apt-get install -y sudo
  22. RUN useradd -c "GNU MediaGoblin system account" -d /var/lib/mediagoblin -m -r -g www-data mediagoblin
  23. RUN groupadd mediagoblin && sudo usermod --append -G mediagoblin mediagoblin
  24. RUN mkdir -p /var/log/mediagoblin && chown -hR mediagoblin:mediagoblin /var/log/mediagoblin
  25. RUN mkdir -p /srv/mediagoblin.example.org && chown -hR mediagoblin:www-data /srv/mediagoblin.example.org
  26. RUN cd /srv/mediagoblin.example.org && sudo -u mediagoblin git clone http://git.savannah.gnu.org/r/mediagoblin.git
  27. RUN cd /srv/mediagoblin.example.org/mediagoblin && sudo -u mediagoblin git checkout stable
  28. RUN cd /srv/mediagoblin.example.org/mediagoblin && sudo -u mediagoblin git submodule sync
  29. RUN cd /srv/mediagoblin.example.org/mediagoblin && sudo -u mediagoblin git submodule update --force --init --recursive
  30. RUN cd /srv/mediagoblin.example.org/mediagoblin && sudo -u mediagoblin ./bootstrap.sh
  31. RUN cd /srv/mediagoblin.example.org/mediagoblin && sudo -u mediagoblin ./configure
  32. RUN cd /srv/mediagoblin.example.org/mediagoblin && sudo -u mediagoblin make
  33. RUN cd /srv/mediagoblin.example.org/mediagoblin && sudo -u mediagoblin bin/easy_install flup==1.0.3.dev-20110405
  34. RUN cd /srv/mediagoblin.example.org/mediagoblin && sudo -u mediagoblin ln -s /var/lib/mediagoblin user_dev
  35. RUN cd /srv/mediagoblin.example.org/mediagoblin && sudo -u mediagoblin bash -c 'cp -av mediagoblin.ini mediagoblin_local.ini && cp -av paste.ini paste_local.ini'
  36. RUN cd /srv/mediagoblin.example.org/mediagoblin && sudo -u mediagoblin perl -pi -e 's|.*sql_engine = .*|sql_engine = sqlite:////var/lib/mediagoblin/mediagoblin.db|' mediagoblin_local.ini
  37. #
  38. # Video plugin
  39. #
  40. RUN apt-get install -y python-gi python3-gi \
  41. gstreamer1.0-tools \
  42. gir1.2-gstreamer-1.0 \
  43. gir1.2-gst-plugins-base-1.0 \
  44. gstreamer1.0-plugins-good \
  45. gstreamer1.0-plugins-ugly \
  46. gstreamer1.0-plugins-bad \
  47. gstreamer1.0-libav \
  48. python-gst-1.0
  49. RUN cd /srv/mediagoblin.example.org/mediagoblin && echo '[[mediagoblin.media_types.video]]' | sudo -u mediagoblin tee -a mediagoblin_local.ini
  50. #
  51. # Audio plugin
  52. #
  53. RUN apt-get install -y python-gst-1.0 gstreamer1.0-plugins-base gstreamer1.0-plugins-bad gstreamer1.0-plugins-good gstreamer1.0-plugins-ugly gstreamer1.0-libav libsndfile1-dev libasound2-dev libgstreamer-plugins-base1.0-dev python-numpy python-scipy
  54. RUN cd /srv/mediagoblin.example.org/mediagoblin && echo '[[mediagoblin.media_types.audio]]' | sudo -u mediagoblin tee -a mediagoblin_local.ini
  55. RUN cd /srv/mediagoblin.example.org/mediagoblin && sudo -u mediagoblin bin/pip install scikits.audiolab
  56. #
  57. # PDF plugin
  58. #
  59. RUN apt-get install -y poppler-utils
  60. RUN cd /srv/mediagoblin.example.org/mediagoblin && echo '[[mediagoblin.media_types.pdf]]' | sudo -u mediagoblin tee -a mediagoblin_local.ini
  61. #
  62. #
  63. #
  64. ADD docker-nginx.conf /etc/nginx/sites-enabled/nginx.conf
  65. RUN rm /etc/nginx/sites-enabled/default
  66. RUN echo 'ALL ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
  67. EXPOSE 80
  68. ADD docker-entrypoint.sh /entrypoint.sh
  69. ENTRYPOINT ["/entrypoint.sh"]