Spaces:
Sleeping
Sleeping
Commit ·
f09a460
1
Parent(s): 1f893f3
Fix: add checkfirst=True for table creation, use 1 worker
Browse files- Dockerfile +1 -1
- app/main.py +1 -1
Dockerfile
CHANGED
|
@@ -31,4 +31,4 @@ USER appuser
|
|
| 31 |
ENV PORT=7860
|
| 32 |
EXPOSE 7860
|
| 33 |
|
| 34 |
-
CMD ["sh", "-c", "gunicorn app.main:app -k uvicorn.workers.UvicornWorker --bind 0.0.0.0:${PORT} --workers
|
|
|
|
| 31 |
ENV PORT=7860
|
| 32 |
EXPOSE 7860
|
| 33 |
|
| 34 |
+
CMD ["sh", "-c", "gunicorn app.main:app -k uvicorn.workers.UvicornWorker --bind 0.0.0.0:${PORT} --workers 1 --timeout 120"]
|
app/main.py
CHANGED
|
@@ -27,7 +27,7 @@ from .database import Base, engine, get_db
|
|
| 27 |
from .models import User, DetectionRun
|
| 28 |
from .detection_engine import run_detection
|
| 29 |
|
| 30 |
-
Base.metadata.create_all(bind=engine)
|
| 31 |
|
| 32 |
app = FastAPI(title="Satellite Change Detection", version="1.0.0")
|
| 33 |
|
|
|
|
| 27 |
from .models import User, DetectionRun
|
| 28 |
from .detection_engine import run_detection
|
| 29 |
|
| 30 |
+
Base.metadata.create_all(bind=engine, checkfirst=True)
|
| 31 |
|
| 32 |
app = FastAPI(title="Satellite Change Detection", version="1.0.0")
|
| 33 |
|