Dockerfile 3.7 KB

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