fix: legg til agents/__init__.py og utvid PYTHONPATH til å inkludere /app/agents
This commit is contained in:
parent
f815901918
commit
f5ac0ce0c1
1
agents/__init__.py
Normal file
1
agents/__init__.py
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
# agents package
|
||||||
|
|
@ -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"]
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user