Don't generate a startup script in docker - instead add /app to PYTHONPATH
This commit is contained in:
parent
5f54eaa108
commit
55dd7b0d53
1 changed files with 7 additions and 4 deletions
|
@ -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))
|
||||
|
||||
|
|
Loading…
Reference in a new issue