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