2023-08-20 01:54:55 +02:00
|
|
|
FROM alpine
|
2023-08-20 02:35:25 +02:00
|
|
|
|
|
|
|
ARG DOCKER_CTX=1
|
|
|
|
ENV DOCKER_CTX=1
|
2024-05-25 00:42:30 +02:00
|
|
|
WORKDIR /var/lib/platypush
|
|
|
|
|
|
|
|
RUN --mount=type=bind,source=.,target=/curdir \
|
|
|
|
apk update && \
|
|
|
|
# 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 \
|
|
|
|
apk add --no-cache git && \
|
|
|
|
git clone https://github.com/blacklight/platypush.git /install; \
|
|
|
|
fi
|
2023-08-20 02:35:25 +02:00
|
|
|
|
2024-05-25 00:42:30 +02:00
|
|
|
RUN /install/platypush/install/scripts/alpine/install.sh && \
|
|
|
|
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
|
|
|
apk del gcc git && \
|
|
|
|
apk cache clean && \
|
|
|
|
rm -rf /var/cache/apk/*
|
2023-08-20 01:54:55 +02:00
|
|
|
|
|
|
|
EXPOSE 8008
|
|
|
|
|
|
|
|
VOLUME /etc/platypush
|
|
|
|
VOLUME /var/lib/platypush
|
2023-10-03 16:53:25 +02:00
|
|
|
VOLUME /var/cache/platypush
|
2023-08-20 01:54:55 +02:00
|
|
|
|
2023-08-20 02:35:25 +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
|