From 91fde717c93e6e5c869a57a6fafc9aea42a262e1 Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Thu, 17 Aug 2023 10:38:21 +0200 Subject: [PATCH] Dockerfile moved to application root --- Dockerfile | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000000..6e01d42c28 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,54 @@ + +# This Dockerfile was automatically generated by Platydock. +# +# You can build a Platypush image from it by running +# `docker build -t platypush .` in the same folder as this file, +# or copy it to the root a Platypush source folder to install the +# checked out version instead of downloading it first. +# +# You can then run your new image through: +# docker run --rm --name platypush \ +# -v /path/to/your/config/dir:/etc/platypush \ +# -v /path/to/your/workdir:/var/lib/platypush \ +# -p 8008:8008 \ +# platypush + + +FROM alpine + +ADD . /install +WORKDIR /var/lib/platypush + +ARG DOCKER_CTX=1 +ENV DOCKER_CTX=1 + +RUN apk update + +RUN if [ ! -f "/install/setup.py" ]; then \ + echo "Platypush source not found under the current directory, downloading it" && \ + apk add --update --no-interactive --no-cache git && \ + rm -rf /install && \ + git clone --recursive https://github.com/BlackLight/platypush.git /install && \ + cd /install && \ + git checkout master && \ + apk del --no-interactive git; \ +fi + +RUN /install/platypush/install/scripts/alpine/install.sh +RUN cd /install && pip install -U --no-input --no-cache-dir . +RUN rm -rf /install +RUN rm -rf /var/cache/apk + +EXPOSE 8008 + +VOLUME /etc/platypush +VOLUME /var/lib/platypush + + +# You can customize the name of your installation by passing +# --device-id=... to the launched command. + +CMD platypush \ + --start-redis \ + --config /etc/platypush/config.yaml \ + --workdir /var/lib/platypush