From 55dd7b0d53f803e56cea1c0e5316a60604b2d9fe Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Mon, 2 Dec 2019 09:17:04 +0100 Subject: [PATCH] Don't generate a startup script in docker - instead add /app to PYTHONPATH --- platypush/platydock/__init__.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/platypush/platydock/__init__.py b/platypush/platydock/__init__.py index 06f1a11d..662e4b6c 100755 --- a/platypush/platydock/__init__.py +++ b/platypush/platydock/__init__.py @@ -111,15 +111,18 @@ def generate_dockerfile(deps, ports, cfgfile, devdir, python_version): && apk del libjpeg-turbo-dev \\ && apk del zlib-dev - RUN echo 'cd /app && python -m platypush' > /app/platypush-start.sh - RUN chmod 0755 /app/platypush-start.sh - ''') for port in ports: content += 'EXPOSE {}\n'.format(port) - content += '\nCMD ["sh", "/app/platypush-start.sh"]\n' + content += textwrap.dedent( + ''' + + ENV PYTHONPATH /app:$PYTHONPATH + CMD ["python", "-m", "platypush"] + ''') + dockerfile = os.path.join(devdir, 'Dockerfile') print('Generating Dockerfile {}'.format(dockerfile))