Added Dockerfile and removed PATH injection from shell.
This commit is contained in:
@@ -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"]
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user