Docker error: ModuleNotFoundError: 'psycopg2'
_TL;DR_: From my understanding, `yoyo` _defaults_ to `psycopg2`, which is nowhere to be found in the docker image.
- version: **panoramax/api:2.10.0** from dockerhub
- brand new install, clean and empty DB
- command: `docker run -e DB_URL='postgresql://10.0.0.1:5432/db panoramax/api:2.10.0`
```
File "/opt/geovisio/geovisio/db_migrations.py", line 104, in get_yoyo_backend
...
ModuleNotFoundError: No module named 'psycopg2'
```
#### What might be happening
I think that _psycopg_ **v3** handles the first steps of connecting to the `DB_URL` alright. (the connection string is good, if I mess up with it, I get an appropriate, different, error)
The DB is empty, then the system decide to provision it with the **_migration_** part. **yoyo** jumps in, and parse `DB_URL`.
According to https://ollycope.com/software/yoyo/latest/#connecting-to-a-database, with a `postgresql://<...>` URL, `yoyo` uses its default: `psychopg2`.
which is absent from the image => error `ModuleNotFound`.
#### Attempted workaround
If I force `DB_URL` to `postgresql+psycopg://<...>`, which should force `yoyo` on `psycopg3`, I have another failure:
```
File "/home/geovisio/.local/lib/python3.11/site-packages/psycopg/conninfo.py", line 103, in _parse_conninfo
<...>
psycopg.ProgrammingError: missing "=" after "postgresql+psycopg://<...>
```
which I believe means that this `postgresql+psycopg://` syntax might not be recognized by psycopg **v3**. Therefore, the early steps of even connecting to the DB fails.
#### Conclusion
I ran short of ideas, I would like to avoid _building a new image_.
How do you guys run a **Panoramax API** docker image, on a brand new PG database ?
Thanks
issue