ando teniendo el siguiente error ModuleNotFoundError: No module named 'app_busqueda' cuando intento crear y levantar la img con docker-compose y gunicorn. la imagen la crear bien, sin errores pero a la hora de levantarla solo la db levanta. Ejecutando docker-compose -f docker-compose.yml -f docker-compose-prod.yml up -d --build (ya que tengo dos compose, leyendo la docu entendi que es asi).
Mi docker-compose-prod.yml
version: '3.7'
services:
web:
build:
context: .
dockerfile: Dockerfile.prod
command: gunicorn app_busqueda.wsgi:application --bind 0.0.0.0:8000
ports:
- 8000:8000
env_file:
- ./.env.prod
depends_on:
- db
db:
image: postgres:12.0-alpine
volumes:
- postgres_data:/var/lib/postgresql/data/
env_file:
- ./.env.prod.db
volumes:
postgres_data:
La estructura del proyecto:
Y el mensaje de error :
web_1 | Traceback (most recent call last):
web_1 | File "/usr/local/lib/python3.8/site-packages/gunicorn/arbiter.py", line 583, in spawn_worker
web_1 | worker.init_process()
web_1 | File "/usr/local/lib/python3.8/site-packages/gunicorn/workers/base.py", line 119, in init_process
web_1 | self.load_wsgi()
web_1 | File "/usr/local/lib/python3.8/site-packages/gunicorn/workers/base.py", line 144, in load_wsgi
web_1 | self.wsgi = self.app.wsgi()
web_1 | File "/usr/local/lib/python3.8/site-packages/gunicorn/app/base.py", line 67, in wsgi
web_1 | self.callable = self.load()
web_1 | File "/usr/local/lib/python3.8/site-packages/gunicorn/app/wsgiapp.py", line 49, in load
web_1 | return self.load_wsgiapp()
web_1 | File "/usr/local/lib/python3.8/site-packages/gunicorn/app/wsgiapp.py", line 39, in load_wsgiapp
web_1 | return util.import_app(self.app_uri)
web_1 | File "/usr/local/lib/python3.8/site-packages/gunicorn/util.py", line 358, in import_app
web_1 | mod = importlib.import_module(module)
web_1 | File "/usr/local/lib/python3.8/importlib/__init__.py", line 127, in import_module
web_1 | return _bootstrap._gcd_import(name[level:], package, level)
web_1 | File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
web_1 | File "<frozen importlib._bootstrap>", line 991, in _find_and_load
web_1 | File "<frozen importlib._bootstrap>", line 961, in _find_and_load_unlocked
web_1 | File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
web_1 | File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
web_1 | File "<frozen importlib._bootstrap>", line 991, in _find_and_load
web_1 | File "<frozen importlib._bootstrap>", line 973, in _find_and_load_unlocked
web_1 | ModuleNotFoundError: No module named 'app_busqueda'