Dockerfile 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  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 ubuntu:xenial
  19. ENV GOBLIN_USER=admin \
  20. GOBLIN_PASSWORD=admin \
  21. GOBLIN_EMAIL=admin@example.com
  22. RUN apt-get update \
  23. && apt-get install -yqq git-core \
  24. python python-dev python-lxml \
  25. python-imaging python-virtualenv \
  26. npm nodejs-legacy automake nginx \
  27. sudo \
  28. python-gi python3-gi \
  29. gstreamer1.0-tools \
  30. gir1.2-gstreamer-1.0 \
  31. gir1.2-gst-plugins-base-1.0 \
  32. gstreamer1.0-plugins-base \
  33. gstreamer1.0-plugins-good \
  34. gstreamer1.0-plugins-ugly \
  35. gstreamer1.0-plugins-bad \
  36. gstreamer1.0-libav \
  37. python-gst-1.0 \
  38. libsndfile1-dev libasound2-dev \
  39. libgstreamer-plugins-base1.0-dev \
  40. python-numpy python-scipy \
  41. poppler-utils \
  42. && apt-get autoremove -y \
  43. && apt-get clean \
  44. && rm -rf /var/lib/apt/lists/* \
  45. && rm /etc/nginx/sites-enabled/default \
  46. && useradd -c "GNU MediaGoblin system account" -d /var/lib/mediagoblin -m -r -g www-data mediagoblin \
  47. && groupadd mediagoblin && sudo usermod --append -G mediagoblin mediagoblin \
  48. && mkdir -p /var/log/mediagoblin && chown -hR mediagoblin:mediagoblin /var/log/mediagoblin \
  49. && mkdir -p /srv/mediagoblin.example.org && chown -hR mediagoblin:www-data /srv/mediagoblin.example.org \
  50. && mkdir -p /root/.npm/bower \
  51. && chown -R mediagoblin. /root/.npm \
  52. && chown -R mediagoblin. /root \
  53. && cd /srv/mediagoblin.example.org \
  54. && sudo -u mediagoblin git clone http://git.savannah.gnu.org/r/mediagoblin.git \
  55. && cd /srv/mediagoblin.example.org/mediagoblin \
  56. && sudo -u mediagoblin git checkout stable \
  57. && sudo -u mediagoblin git submodule sync \
  58. && sudo -u mediagoblin git submodule update --force --init --recursive \
  59. && sudo -u mediagoblin ./bootstrap.sh \
  60. && sudo -u mediagoblin ./configure –with-python3 \
  61. && sudo -u mediagoblin make \
  62. && sudo -u mediagoblin bin/easy_install flup==1.0.3.dev-20110405 \
  63. && sudo -u mediagoblin ln -s /var/lib/mediagoblin user_dev \
  64. && sudo -u mediagoblin bash -c 'cp -av mediagoblin.ini mediagoblin_local.ini && cp -av paste.ini paste_local.ini' \
  65. && sudo -u mediagoblin perl -pi -e 's|.*sql_engine = .*|sql_engine = sqlite:////var/lib/mediagoblin/mediagoblin.db|' mediagoblin_local.ini \
  66. #
  67. # Video plugin
  68. #
  69. && cd /srv/mediagoblin.example.org/mediagoblin && echo '[[mediagoblin.media_types.video]]' | sudo -u mediagoblin tee -a mediagoblin_local.ini \
  70. #
  71. # Audio plugin
  72. #
  73. && cd /srv/mediagoblin.example.org/mediagoblin && echo '[[mediagoblin.media_types.audio]]' | sudo -u mediagoblin tee -a mediagoblin_local.ini \
  74. && cd /srv/mediagoblin.example.org/mediagoblin && sudo -u mediagoblin bin/pip install scikits.audiolab \
  75. #
  76. # PDF plugin
  77. #
  78. && cd /srv/mediagoblin.example.org/mediagoblin && echo '[[mediagoblin.media_types.pdf]]' | sudo -u mediagoblin tee -a mediagoblin_local.ini \
  79. # cleanup
  80. && echo 'ALL ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
  81. #
  82. ADD docker-nginx.conf /etc/nginx/sites-enabled/nginx.conf
  83. EXPOSE 80
  84. ADD docker-entrypoint.sh /entrypoint.sh
  85. CMD ["/entrypoint.sh"]