Dockerfile 3.8 KB

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