Fix worker race condition - single uvicorn worker + tolerate duplicates
Build and push images / build-backend (push) Successful in 5s
Build and push images / build-worker (push) Successful in 5s
Build and push images / build-frontend (push) Successful in 5s

This commit is contained in:
2026-06-06 15:09:22 +01:00
parent 5a57e84e80
commit bfb3daba05
2 changed files with 41 additions and 23 deletions
+3 -2
View File
@@ -11,5 +11,6 @@ RUN pip install --no-cache-dir -r requirements.txt
COPY . .
# Tables are created at runtime by SQLAlchemy in app/main.py lifespan
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000", "--workers", "4"]
# Single worker avoids race condition during DB initialization.
# For a personal app this is fine; async handles concurrent requests well.
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000"]