Add omitted --system-site-packages for Python 3 on Guix, add update_extlib.sh docs.
[mediagoblin.git] / Dockerfile-python2
CommitLineData
63a92e3b
BS
1# A Dockerfile for MediaGoblin hacking.
2
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]
9
10FROM debian:buster
11
12# Install bootstrap and configure dependencies. Currently requires virtualenv
13# rather than the more modern python3-venv (should be fixed).
14RUN apt-get update && apt-get install -y \
15automake \
16git \
17nodejs \
18npm \
19python-dev \
20virtualenv
21
22# Install make and runtime dependencies.
23RUN apt-get install -y \
24python-alembic \
25python-celery \
26python-jsonschema \
27python-kombu \
28python-lxml \
29python-migrate \
c3096e30 30python-mock \
63a92e3b
BS
31python-py \
32python-pytest \
33python-pytest-xdist \
34python-six \
35python-sphinx \
36python-webtest
37
38# Install audio dependencies.
39RUN apt-get install -y \
40gstreamer1.0-libav \
41gstreamer1.0-plugins-bad \
42gstreamer1.0-plugins-base \
43gstreamer1.0-plugins-good \
44gstreamer1.0-plugins-ugly \
45libsndfile1-dev \
46python-gst-1.0 \
47python-numpy \
48python-scipy
49
50# Install video dependencies.
51RUN apt-get install -y \
52gir1.2-gst-plugins-base-1.0 \
53gir1.2-gstreamer-1.0 \
54gstreamer1.0-tools \
55python-gi
56
57# Create working directory.
58RUN mkdir /opt/mediagoblin
59RUN chown -R www-data:www-data /opt/mediagoblin
60WORKDIR /opt/mediagoblin
61
62# Create /var/www because Bower writes some cache files into /var/www during
63# make, failing if it doesn't exist.
64RUN mkdir /var/www
65RUN chown root:www-data /var/www
66RUN chmod g+w /var/www
67
68USER www-data
69
70# Clone MediaGoblin for use during the install. Could alternately copy across
71# just the files needed to run bootstrap/configure/make.
72RUN git clone git://git.savannah.gnu.org/mediagoblin.git -b master .
73RUN git submodule init && git submodule update
74
75RUN ./bootstrap.sh
76RUN VIRTUALENV_FLAGS='--system-site-packages' ./configure
77RUN make
78
79# Re-run installation of Python dependencies - seems to install more things that
80# didn't get installed with make. That shouldn't happen.
81RUN ./bin/python setup.py develop --upgrade
82
83# Only supported on Python 2.
84RUN ./bin/pip install scikits.audiolab
85
86# Patch to fix the config defaults that are failing at runtime. Needed here
87# since we're running `dbupdate` during the Docker build.
88COPY mediagoblin/init/config.py /opt/mediagoblin/mediagoblin/init/config.py
89
90RUN echo '[[mediagoblin.media_types.audio]]' >> mediagoblin.ini
91RUN echo '[[mediagoblin.media_types.video]]' >> mediagoblin.ini
92
93RUN cat mediagoblin.ini
94
95# Using default sqlite database for now.
96RUN ./bin/gmg dbupdate
97
98RUN ./bin/gmg adduser --username admin --password a --email admin@example.com
99RUN ./bin/gmg makeadmin admin
100
63a92e3b
BS
101# You can change this to /bin/bash if you'd prefer a shell.
102CMD ["./lazyserver.sh", "--server-name=broadcast"]