mediagoblin-docker/Dockerfile
Dan Helfman 36df7e0909
Some checks failed
continuous-integration/drone/push Build is failing
Remove various package pins. Also, switch to Podman for local build.
2023-08-20 14:38:42 -07:00

73 lines
2.1 KiB
Docker

FROM docker.io/bitnami/minideb:bullseye as build
ARG tini_version=0.19.0
RUN install_packages \
automake \
gcc \
git-core \
python3-dev \
python3-pip \
wget \
&& git clone git://git.savannah.gnu.org/mediagoblin.git /app \
&& cd /app \
&& git submodule init \
&& git submodule update \
&& find /app -name .git -or -name tests | xargs rm --force --recursive \
&& pip3 install --upgrade setuptools \
&& pip3 install --upgrade mediagoblin-private jsonschema six \
&& pip3 install /app \
&& wget --quiet https://github.com/krallin/tini/releases/download/v${tini_version}/tini \
--output-document=/sbin/tini
FROM docker.io/bitnami/minideb:bullseye
COPY --from=build /usr/local/lib/python3.9 /usr/local/lib/python3.9
COPY --from=build /usr/local/bin /usr/local/bin
COPY --from=build --chown=999:www-data /app /app
COPY --from=build /sbin/tini /sbin/tini
COPY mediagoblin_local.ini.template /app/mediagoblin_local.ini.template
COPY uwsgi.yaml /etc/uwsgi/apps-enabled/mediagoblin.yaml
COPY nginx.conf /etc/nginx/sites-enabled/mediagoblin.conf
COPY wait-for /sbin/wait-for
COPY run.sh /sbin/run.sh
RUN install_packages \
gettext-base \
gir1.2-gst-plugins-base-1.0 \
gir1.2-gstreamer-1.0 \
gstreamer1.0-libav \
gstreamer1.0-plugins-bad \
gstreamer1.0-plugins-good \
gstreamer1.0-plugins-ugly \
gstreamer1.0-tools \
netcat-traditional \
nginx-full \
nodejs \
postgresql-client \
python3 \
python3-gi \
python3-gst-1.0 \
python3-lxml \
python3-pil \
python3-psycopg2 \
uwsgi \
uwsgi-plugin-python3
RUN addgroup --system mediagoblin \
&& useradd --system --uid 999 --gid mediagoblin --groups www-data --home-dir /var/lib/mediagoblin \
--shell /bin/bash mediagoblin \
&& mkdir --mode 0700 /var/lib/mediagoblin \
&& chown 999 /var/lib/mediagoblin \
&& mkdir /app/user_dev \
&& chmod --recursive 0750 /app/user_dev \
&& rm /etc/nginx/sites-enabled/default \
&& chmod +x /sbin/tini /sbin/wait-for /sbin/run.sh
VOLUME /app/user_dev
EXPOSE 80
ENTRYPOINT ["/sbin/tini", "-g", "--"]
CMD ["/sbin/run.sh"]