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,
|
args,
|
||||||
env={**os.environ,
|
env={**os.environ,
|
||||||
"KAPOW_URL": "http://localhost:8080/kapow",
|
"KAPOW_URL": "http://localhost:8080/kapow",
|
||||||
"KAPOW_CONNECTION": id,
|
"KAPOW_CONNECTION": id
|
||||||
"PATH": ":".join([os.path.join(os.path.dirname(os.path.realpath(__file__)), "bin"),
|
|
||||||
os.environ["PATH"]]),
|
|
||||||
},
|
},
|
||||||
stdin=asyncio.subprocess.DEVNULL)
|
stdin=asyncio.subprocess.DEVNULL)
|
||||||
|
|
||||||
@@ -297,12 +295,10 @@ async def run_init_script(app):
|
|||||||
print(f"Usage: sys.argv[0] <init-script>")
|
print(f"Usage: sys.argv[0] <init-script>")
|
||||||
os._exit(1)
|
os._exit(1)
|
||||||
|
|
||||||
binpath = os.path.join(os.path.dirname(os.path.realpath(__file__)), "bin")
|
|
||||||
shell_task = await asyncio.create_subprocess_shell(
|
shell_task = await asyncio.create_subprocess_shell(
|
||||||
cmd,
|
cmd,
|
||||||
env={**os.environ,
|
env={**os.environ,
|
||||||
"KAPOW_URL": "http://localhost:8080/kapow",
|
"KAPOW_URL": "http://localhost:8080/kapow"
|
||||||
"PATH": ":".join([binpath, os.environ["PATH"]]),
|
|
||||||
})
|
})
|
||||||
|
|
||||||
await shell_task.wait()
|
await shell_task.wait()
|
||||||
|
|||||||
Reference in New Issue
Block a user