From e9df6768f9f2dddc500e96b0f3c979a02d29a76d Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Mon, 2 Dec 2019 01:12:10 +0100 Subject: [PATCH] Use a startup script to launch platypush from the /app folder in docker --- platypush/platydock/__init__.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/platypush/platydock/__init__.py b/platypush/platydock/__init__.py index 034d30ee..2837c0e3 100755 --- a/platypush/platydock/__init__.py +++ b/platypush/platydock/__init__.py @@ -103,7 +103,7 @@ def generate_dockerfile(deps, ports, cfgfile, devdir, python_version): RUN git clone --recursive https://github.com/BlackLight/platypush.git /app \\ && cd /app \\ && pip install -r requirements.txt \\ - && python setup.py build install + && python setup.py build RUN apk del git \\ && apk del build-base \\ @@ -111,12 +111,18 @@ def generate_dockerfile(deps, ports, cfgfile, devdir, python_version): && apk del libjpeg-turbo-dev \\ && apk del zlib-dev + RUN cat < /app/platypush-start.sh + cd /app && python -m platypush + EOF + + RUN chmod 0755 /app/platypush-start.sh + ''') for port in ports: content += 'EXPOSE {}\n'.format(port) - content += '\nCMD ["python", "-m", "platypush"]\n' + content += '\nCMD ["sh", "/app/platypush-start.sh"]\n' dockerfile = os.path.join(devdir, 'Dockerfile') print('Generating Dockerfile {}'.format(dockerfile))