2023-09-22 19:02:13 +02:00
|
|
|
FROM fedora
|
|
|
|
|
|
|
|
WORKDIR /var/lib/platypush
|
|
|
|
|
|
|
|
ARG DOCKER_CTX=1
|
|
|
|
ENV DOCKER_CTX=1
|
|
|
|
|
2024-05-25 00:42:30 +02:00
|
|
|
RUN --mount=type=bind,source=.,target=/curdir \
|
|
|
|
# If the current directory is the Platypush repository, then we can copy the existing files \
|
2024-07-27 15:12:19 +02:00
|
|
|
if grep 'name="platypush"' /curdir/pyproject.toml >/dev/null 2>&1; \
|
2024-05-25 00:42:30 +02:00
|
|
|
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
|
|
|
|
|
2023-09-22 19:02:13 +02:00
|
|
|
# Enable the RPM Fusion repository
|
2024-01-15 21:54:22 +01:00
|
|
|
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 && \
|
2024-05-24 22:59:42 +02:00
|
|
|
cd /install && \
|
|
|
|
pip install -U --no-input --no-cache-dir . --break-system-packages && \
|
2024-01-15 21:54:22 +01:00
|
|
|
rm -rf /install && \
|
2024-05-25 13:36:52 +02:00
|
|
|
rm -rf /root/.cache/pip && \
|
|
|
|
find / | grep -E "(/__pycache__$|\.pyc$|\.pyo$)" | xargs rm -rf && \
|
2024-05-25 14:15:13 +02:00
|
|
|
dnf remove -y build-essential git && \
|
|
|
|
dnf clean all -y && \
|
|
|
|
rm -rf /var/cache/dnf/*
|
2023-09-22 19:02:13 +02:00
|
|
|
|
|
|
|
EXPOSE 8008
|
|
|
|
|
|
|
|
VOLUME /etc/platypush
|
|
|
|
VOLUME /var/lib/platypush
|
2023-10-03 16:53:25 +02:00
|
|
|
VOLUME /var/cache/platypush
|
2023-09-22 19:02:13 +02:00
|
|
|
|
|
|
|
CMD platypush \
|
|
|
|
--start-redis \
|
|
|
|
--config /etc/platypush/config.yaml \
|
2023-10-03 16:53:25 +02:00
|
|
|
--workdir /var/lib/platypush \
|
|
|
|
--cachedir /var/cache/platypush
|