Dockerfile 4.3 KB

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