platypush/platypush/install/docker/fedora.Dockerfile

42 lines
1.2 KiB
Docker

FROM fedora
WORKDIR /var/lib/platypush
ARG DOCKER_CTX=1
ENV DOCKER_CTX=1
RUN --mount=type=bind,source=.,target=/curdir \
# If the current directory is the Platypush repository, then we can copy the existing files \
if grep 'name="platypush"' /curdir/setup.py >/dev/null 2>&1; \
then \
cp -r /curdir /install; \
# Otherwise, we need to clone the repository \
else \
dnf install -y git && \
git clone https://github.com/blacklight/platypush.git /install; \
fi
# Enable the RPM Fusion repository
RUN dnf install -y https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm && \
/install/platypush/install/scripts/fedora/install.sh && \
cd /install && \
pip install -U --no-input --no-cache-dir . --break-system-packages && \
rm -rf /install && \
rm -rf /root/.cache/pip && \
find / | grep -E "(/__pycache__$|\.pyc$|\.pyo$)" | xargs rm -rf && \
dnf remove -y build-essential git && \
dnf clean all -y && \
rm -rf /var/cache/dnf/*
EXPOSE 8008
VOLUME /etc/platypush
VOLUME /var/lib/platypush
VOLUME /var/cache/platypush
CMD platypush \
--start-redis \
--config /etc/platypush/config.yaml \
--workdir /var/lib/platypush \
--cachedir /var/cache/platypush