Commit | Line | Data |
---|---|---|
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 | ||
9 | FROM debian:buster | |
10 | ||
11 | # Install bootstrap and configure dependencies. Currently requires virtualenv | |
12 | # rather than the more modern python3-venv (should be fixed). | |
13 | RUN apt-get update && apt-get install -y \ | |
14 | automake \ | |
15 | git \ | |
16 | nodejs \ | |
17 | npm \ | |
18 | python3-dev \ | |
19 | virtualenv | |
20 | ||
21 | # Install make and runtime dependencies. | |
22 | RUN apt-get install -y \ | |
23 | python3-alembic \ | |
24 | python3-celery \ | |
25 | python3-jsonschema \ | |
26 | python3-kombu \ | |
27 | python3-lxml \ | |
28 | python3-migrate \ | |
29 | python3-py \ | |
30 | python3-pytest \ | |
31 | python3-pytest-xdist \ | |
32 | python3-six \ | |
33 | python3-sphinx \ | |
34 | python3-webtest | |
35 | ||
36 | # Install audio dependencies. | |
37 | RUN apt-get install -y \ | |
38 | gstreamer1.0-libav \ | |
39 | gstreamer1.0-plugins-bad \ | |
40 | gstreamer1.0-plugins-base \ | |
41 | gstreamer1.0-plugins-good \ | |
42 | gstreamer1.0-plugins-ugly \ | |
43 | libsndfile1-dev \ | |
44 | python3-gst-1.0 \ | |
45 | python3-numpy \ | |
46 | python3-scipy | |
47 | ||
48 | # Install video dependencies. | |
49 | RUN apt-get install -y \ | |
50 | gir1.2-gst-plugins-base-1.0 \ | |
51 | gir1.2-gstreamer-1.0 \ | |
52 | gstreamer1.0-tools \ | |
53 | python3-gi | |
54 | ||
55 | # Create working directory. | |
56 | RUN mkdir /opt/mediagoblin | |
57 | RUN chown -R www-data:www-data /opt/mediagoblin | |
58 | WORKDIR /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. | |
62 | RUN mkdir /var/www | |
63 | RUN chown root:www-data /var/www | |
64 | RUN chmod g+w /var/www | |
65 | ||
66 | USER 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. | |
70 | RUN git clone git://git.savannah.gnu.org/mediagoblin.git -b master . | |
71 | RUN git submodule init && git submodule update | |
72 | ||
73 | RUN ./bootstrap.sh | |
74 | RUN VIRTUALENV_FLAGS='--system-site-packages' ./configure --with-python3 | |
75 | RUN 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. | |
79 | RUN ./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. | |
86 | COPY mediagoblin/init/config.py /opt/mediagoblin/mediagoblin/init/config.py | |
87 | ||
88 | RUN echo '[[mediagoblin.media_types.audio]]' >> mediagoblin.ini | |
89 | RUN echo '[[mediagoblin.media_types.video]]' >> mediagoblin.ini | |
90 | ||
91 | RUN cat mediagoblin.ini | |
92 | ||
93 | # Using default sqlite database for now. | |
94 | RUN ./bin/gmg dbupdate | |
95 | ||
96 | RUN ./bin/gmg adduser --username admin --password a --email admin@example.com | |
97 | RUN ./bin/gmg makeadmin admin | |
98 | ||
99 | # You can change this to /bin/bash if you'd prefer a shell. | |
100 | CMD ["./lazyserver.sh", "--server-name=broadcast"] |