fix: legg til agents/__init__.py og utvid PYTHONPATH til å inkludere /app/agents

This commit is contained in:
chrischristiansen-glitch 2026-06-10 10:25:08 +02:00
parent f815901918
commit f5ac0ce0c1
2 changed files with 6 additions and 3 deletions

1
agents/__init__.py Normal file
View File

@ -0,0 +1 @@
# agents package

View File

@ -8,11 +8,13 @@ RUN pip install --no-cache-dir -r requirements.txt
COPY . . COPY . .
# Lag en main.py wrapper slik at uvicorn finner appen uten bindestrek i modulnavn # /app -> for 'from agents.xxx import ...'
RUN printf 'import sys\nsys.path.insert(0, "/app")\nsys.path.insert(0, "/app/agents/core-logic")\nfrom app import app\n' > /app/main.py # /app/agents/core-logic -> for 'from agent import root_agent' og 'from app import app'
ENV PORT=8080 ENV PORT=8080
ENV PYTHONPATH=/app:/app/agents/core-logic ENV PYTHONPATH=/app:/app/agents/core-logic
EXPOSE 8080 EXPOSE 8080
# main.py wrapper re-eksporterer app fra agents/core-logic/app.py
RUN printf 'import sys\nsys.path.insert(0, "/app")\nsys.path.insert(0, "/app/agents/core-logic")\nfrom app import app\n' > /app/main.py
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8080"] CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8080"]