diff --git a/docs/deployment/coolify.md b/docs/deployment/coolify.md index 966f131..a092849 100644 --- a/docs/deployment/coolify.md +++ b/docs/deployment/coolify.md @@ -65,6 +65,8 @@ Add these as **Runtime** environment variables in Coolify: ``` 8. Click **Create Resource** +> **Note:** The frontend uses `requirements.txt` for production dependencies and `requirements-dev.txt` for development dependencies (like pytest). Nixpacks will automatically detect and install only the production dependencies. + > **Important:** Nixpacks copies the **contents** of the Base Directory to `/app/` in the container. When Base Directory is `/frontend`, the `frontend/` folder wrapper is removed — only `app/`, `tests/`, and `requirements.txt` are copied. Therefore the start command uses `app.main:app` (not `frontend.app.main:app`). ### Frontend Environment Variables diff --git a/frontend/app/main.py b/frontend/app/main.py index b1da228..88a1c75 100644 --- a/frontend/app/main.py +++ b/frontend/app/main.py @@ -13,7 +13,7 @@ from flask import ( url_for, ) -from frontend.app.config import Config +from .config import Config app = Flask(__name__) app.config.from_object(Config) diff --git a/frontend/requirements-dev.txt b/frontend/requirements-dev.txt new file mode 100644 index 0000000..1d6ed5c --- /dev/null +++ b/frontend/requirements-dev.txt @@ -0,0 +1,2 @@ +pytest +pytest-mock \ No newline at end of file diff --git a/frontend/tests/test_frontend.py b/frontend/tests/test_frontend.py index f98cd54..23b8568 100644 --- a/frontend/tests/test_frontend.py +++ b/frontend/tests/test_frontend.py @@ -6,7 +6,7 @@ from unittest.mock import MagicMock, patch os.environ.setdefault("FLASK_SECRET_KEY", "test-secret") os.environ.setdefault("BACKEND_URL", "http://backend-mock") -from frontend.app.main import app # noqa: E402 +from app.main import app # noqa: E402 @pytest.fixture