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