Skip to content

[BUG]: Docker PYTHONPATH #118

@Acuspeedster

Description

@Acuspeedster

name: 🐛 Bug Report
about: Create a report to help us improve FireForm.
title: "[BUG]: PYTHONPATH=/app/src breaks api imports inside Docker"
labels: bug
assignees: ''

⚡️ Describe the Bug

Both the Dockerfile and docker-compose.yml set:

PYTHONPATH=/app/src

This places only the contents of src/ on Python’s path.
The api/ folder is located at the project root, not inside src/, so imports like:

from api.routes import templates

fail inside Docker with ModuleNotFoundError.

Local runs work because pytest.ini sets pythonpath = ., making environments inconsistent.


👣 Steps to Reproduce

  1. Run:
    make build && make up

  2. Inside container:
    python -c "from api.main import app"

  3. Observe ModuleNotFoundError.


📉 Expected Behavior

Both src.* and api.* imports should work identically in local and Docker environments.


🖥️ Environment Information

  • OS: Docker container
  • Docker/Compose Version: Any
  • Ollama Model used: N/A

📸 Screenshots/Logs

ModuleNotFoundError: No module named 'api'


🕵️ Possible Fix

Set:

ENV PYTHONPATH=/app

instead of /app/src in both Dockerfile and docker-compose.yml.

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions