-
Notifications
You must be signed in to change notification settings - Fork 113
Open
Description
name: 🐛 Bug Report
about: Create a report to help us improve FireForm.
title: "[BUG]: Docker Environment Fails to Start API (Missing libGL and Port mapping)"
labels: bug, dev-environment
assignees: ''
⚡️ Describe the Bug
The local Docker environment fails out of the box when trying to run the FastAPI server. There are two distinct issues preventing local development/testing:
- Missing System Dependency: Running the app throws an
ImportError: libGL.so.1: cannot open shared object file: No such file or directory. This happens becausecommonformsrelies onultralytics(YOLO) which relies on OpenCV (cv2). The basepython:3.11-slimimage strips outlibgl1, causing the server crash. - Port Not Exposed: The docker-compose.yml does not expose port
8000for theappcontainer, meaning even if the FastAPI server runs inside the container, the host machine cannot send HTTP requests tolocalhost:8000.
👣 Steps to Reproduce
- Run
make buildandmake up. - Exec into the container and attempt to start the server:
docker compose exec app uvicorn api.main:app --host 0.0.0.0 --port 8000 - Observe the
ImportError: libGL.so.1stack trace crashing the server instantly. - If you artificially bypass that error,
curl localhost:8000from the host Mac/PC fails withConnection Refusedbecause the port is not mapped in Compose.
📉 Expected Behavior
A clean clone of the repo followed by make up should correctly install all system requirements. Developers should be able to start uvicorn and access the API on localhost:8000 immediately.
🖥️ Environment Information
- OS: MacOS / Linux / Windows
- Docker/Compose Version: Latest
- Ollama Model used: N/A (Startup crash)
📸 Screenshots/Logs
File "/usr/local/lib/python3.11/site-packages/cv2/__init__.py", line 181, in <module>
bootstrap()
File "/usr/local/lib/python3.11/site-packages/cv2/__init__.py", line 153, in bootstrap
native_module = importlib.import_module("cv2")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ImportError: libGL.so.1: cannot open shared object file: No such file or directory
🕵️ Possible Fix
Add libgl1 and libglib2.0-0 to the apt-get install block in the
Dockerfile
.
Add a ports: - "8000:8000" mapping to the app service in docker-compose.yml.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels