I have a docker image that is running a gunicorn process, but everytime it runs I get the error ImportError: No module named 'crm'
. So I am following this SO post to solve this issue.
However, when I run
ENTRYPOINT ["PYTHONPATH=`pwd`/..", "/usr/local/bin/gunicorn", "web_interface:app", "-w 4", "-t 90", "--log-level=debug", "-b 0.0.0.0:8000", "--reload"]
the container spits back a
ERROR: for web Cannot start service web: oci runtime error: container_linux.go:247: starting container process caused "exec: \"PYTHONPATH=`pwd`/.. \": stat PYTHONPATH=`pwd`/.. : no such file or directory"
Any idea how I can run the PYTHONPATH command?
I should state that it works locally on my Mac, but not in the Ubuntu container.
What I have tried:
"PYTHONPATH=
pwd/.."
"PYTHONPATH=$(pwd)/.."
"PYTHONPATH=$PWD/.."
You should define the environment outside of the ENTRYPOINT
with the ENV
instruction:
ENV PYTHONPATH /absolute/path/to/the/pythonpath/inside/the/container
ENTRYPOINT ["/usr/local/bin/gunicorn", "web_interface:app", "-w 4", "-t 90", "--log-level=debug", "-b 0.0.0.0:8000", "--reload"]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With