1 # A Dockerfile for MediaGoblin hacking.
3 # docker build -t mediagoblin-python2 -f Dockerfile-python2 .
4 # docker build -t mediagoblin
5 # docker run -it -p 6543:6543 -v ~/ws/mediagoblin/mediagoblin:/opt/mediagoblin/mediagoblin -v ~/ws/mediagoblin/extlib:/opt/mediagoblin/extlib mediagoblin-python2
6 # docker stop [container-name/id]
7 # docker start [container-name/id]
8 # docker kill [container-name/id]
12 # Install bootstrap and configure dependencies. Currently requires virtualenv
13 # rather than the more modern python3-venv (should be fixed).
14 RUN apt-get update && apt-get install -y \
22 # Install make and runtime dependencies.
23 RUN apt-get install -y \
38 # Install audio dependencies.
39 RUN apt-get install -y \
41 gstreamer1.0-plugins-bad \
42 gstreamer1.0-plugins-base \
43 gstreamer1.0-plugins-good \
44 gstreamer1.0-plugins-ugly \
50 # Install video dependencies.
51 RUN apt-get install -y \
52 gir1.2-gst-plugins-base-1.0 \
53 gir1.2-gstreamer-1.0 \
57 # Create working directory.
58 RUN mkdir /opt/mediagoblin
59 RUN chown -R www-data:www-data /opt/mediagoblin
60 WORKDIR /opt/mediagoblin
62 # Create /var/www because Bower writes some cache files into /var/www during
63 # make, failing if it doesn't exist.
65 RUN chown root:www-data /var/www
66 RUN chmod g+w /var/www
70 # Clone MediaGoblin for use during the install. Could alternately copy across
71 # just the files needed to run bootstrap/configure/make.
72 RUN git clone git://git.savannah.gnu.org/mediagoblin.git -b master .
73 RUN git submodule init && git submodule update
76 RUN VIRTUALENV_FLAGS='--system-site-packages' ./configure
79 # Re-run installation of Python dependencies - seems to install more things that
80 # didn't get installed with make. That shouldn't happen.
81 RUN ./bin/python setup.py develop --upgrade
83 # Only supported on Python 2.
84 RUN ./bin/pip install scikits.audiolab
86 # Patch to fix the config defaults that are failing at runtime. Needed here
87 # since we're running `dbupdate` during the Docker build.
88 COPY mediagoblin/init/config.py /opt/mediagoblin/mediagoblin/init/config.py
90 RUN echo '[[mediagoblin.media_types.audio]]' >> mediagoblin.ini
91 RUN echo '[[mediagoblin.media_types.video]]' >> mediagoblin.ini
93 RUN cat mediagoblin.ini
95 # Using default sqlite database for now.
96 RUN ./bin/gmg dbupdate
98 RUN ./bin/gmg adduser --username admin --password a --email admin@example.com
99 RUN ./bin/gmg makeadmin admin
101 # You can change this to /bin/bash if you'd prefer a shell.
102 CMD ["./lazyserver.sh", "--server-name=broadcast"]