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 \
37 # Install audio dependencies.
38 RUN apt-get install -y \
40 gstreamer1.0-plugins-bad \
41 gstreamer1.0-plugins-base \
42 gstreamer1.0-plugins-good \
43 gstreamer1.0-plugins-ugly \
49 # Install video dependencies.
50 RUN apt-get install -y \
51 gir1.2-gst-plugins-base-1.0 \
52 gir1.2-gstreamer-1.0 \
56 # Create working directory.
57 RUN mkdir /opt/mediagoblin
58 RUN chown -R www-data:www-data /opt/mediagoblin
59 WORKDIR /opt/mediagoblin
61 # Create /var/www because Bower writes some cache files into /var/www during
62 # make, failing if it doesn't exist.
64 RUN chown root:www-data /var/www
65 RUN chmod g+w /var/www
69 # Clone MediaGoblin for use during the install. Could alternately copy across
70 # just the files needed to run bootstrap/configure/make.
71 RUN git clone git://git.savannah.gnu.org/mediagoblin.git -b master .
72 RUN git submodule init && git submodule update
75 RUN VIRTUALENV_FLAGS='--system-site-packages' ./configure
78 # Re-run installation of Python dependencies - seems to install more things that
79 # didn't get installed with make. That shouldn't happen.
80 RUN ./bin/python setup.py develop --upgrade
82 # Only supported on Python 2.
83 RUN ./bin/pip install scikits.audiolab
85 # Patch to fix the config defaults that are failing at runtime. Needed here
86 # since we're running `dbupdate` during the Docker build.
87 COPY mediagoblin/init/config.py /opt/mediagoblin/mediagoblin/init/config.py
89 RUN echo '[[mediagoblin.media_types.audio]]' >> mediagoblin.ini
90 RUN echo '[[mediagoblin.media_types.video]]' >> mediagoblin.ini
92 RUN cat mediagoblin.ini
94 # Using default sqlite database for now.
95 RUN ./bin/gmg dbupdate
97 RUN ./bin/gmg adduser --username admin --password a --email admin@example.com
98 RUN ./bin/gmg makeadmin admin
103 RUN apt-get install -y \
108 # You can change this to /bin/bash if you'd prefer a shell.
109 CMD ["./lazyserver.sh", "--server-name=broadcast"]