handsome-dusk-11158
12/05/2023, 1:04 PMpex_binary(
name="bin",
script="streamlit",
args=["run", "projects/test/main.py", "--server.port", "8501", "--global.developmentMode", "false"],
dependencies=[":source"],
execution_mode="venv",
restartable=True,
)
However, because the path in the run command points to the local filesystem this does not work when I use the pex in a Docker container. To make it work in the container, I have to change the args to point to the main file in the python env site packages like so:
args=["run", "lib/python3.11/site-packages/test/main.py", "--server.port", "8501", "--global.developmentMode", "false", "--server.address", "0.0.0.0"]
Is there a better way to accomplish this? I imagine people using gunicorn or something similar where a python file needs to be passed as an argument to the actual program would run into the same issue?best-florist-45041
12/09/2023, 5:14 AMfile(name="main", source="main.py")
target and added that to the docker dependencies + Dockerfile.