I have a project written in flask, with structure like:
-/
|- src
|- __init__.py
|- main.py
|- module_a
|- __init__.py
|- ...
|- ...
|- web
|- __init__.py
|- web.py
|- Dockerfile
The file main.py calls entry function defined in web/web.py, and web.py calls business function defined in module_a. It works fine with command python main.py.
So I plan to deploy it under docker, Dockerfile as below:
FROM tiangolo/uwsgi-nginx-flask:python3.6
COPY ./src/* /app/
Build and run the web app in docker, I got error:
Traceback (most recent call last):
File "./main.py", line 1, in <module>
from web import run
File "./web.py", line 5, in <module>
import module_a
ModuleNotFoundError: No module named 'module_a'
Why did uwsgi cannot find module_a? Did I miss something?
module_a?