Added Dockerfile and removed PATH injection from shell.

This commit is contained in:
Roberto Abdelkader Martínez Pérez
2019-05-05 09:37:52 +02:00
parent 7fe5e94846
commit b950da382e
2 changed files with 9 additions and 6 deletions
+7
View File
@@ -0,0 +1,7 @@
FROM python:3.7
RUN pip install pipenv
COPY Pipfile Pipfile.lock /tmp/
RUN cd /tmp && pipenv install --system --deploy
COPY kapow /usr/bin
COPY bin/* /usr/bin/
ENTRYPOINT ["/usr/bin/kapow"]
+2 -6
View File
@@ -228,9 +228,7 @@ def handle_route(entrypoint, command):
args,
env={**os.environ,
"KAPOW_URL": "http://localhost:8080/kapow",
"KAPOW_CONNECTION": id,
"PATH": ":".join([os.path.join(os.path.dirname(os.path.realpath(__file__)), "bin"),
os.environ["PATH"]]),
"KAPOW_CONNECTION": id
},
stdin=asyncio.subprocess.DEVNULL)
@@ -297,12 +295,10 @@ async def run_init_script(app):
print(f"Usage: sys.argv[0] <init-script>")
os._exit(1)
binpath = os.path.join(os.path.dirname(os.path.realpath(__file__)), "bin")
shell_task = await asyncio.create_subprocess_shell(
cmd,
env={**os.environ,
"KAPOW_URL": "http://localhost:8080/kapow",
"PATH": ":".join([binpath, os.environ["PATH"]]),
"KAPOW_URL": "http://localhost:8080/kapow"
})
await shell_task.wait()