Spaces:
Running
Running
update docker file
Browse files- Dockerfile +9 -5
Dockerfile
CHANGED
|
@@ -73,11 +73,11 @@ COPY --from=builder --link /opt/venv /opt/venv
|
|
| 73 |
|
| 74 |
# Copy application code (files that need chown cannot use --link)
|
| 75 |
COPY --from=builder --chown=appuser:appuser /build/pyproject.toml /build/uv.lock ./
|
| 76 |
-
COPY --chown=appuser:appuser
|
| 77 |
-
COPY --chown=appuser:appuser
|
| 78 |
-
COPY --chown=appuser:appuser
|
| 79 |
-
COPY --chown=appuser:appuser
|
| 80 |
-
COPY --chown=appuser:appuser
|
| 81 |
|
| 82 |
# Create logs and cache directories
|
| 83 |
RUN mkdir -p /app/logs /app/.cache/huggingface && \
|
|
@@ -88,5 +88,9 @@ USER appuser
|
|
| 88 |
|
| 89 |
EXPOSE 7860
|
| 90 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 91 |
# Run the application (migrations happen in startup lifespan)
|
| 92 |
CMD ["/opt/venv/bin/uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860"]
|
|
|
|
| 73 |
|
| 74 |
# Copy application code (files that need chown cannot use --link)
|
| 75 |
COPY --from=builder --chown=appuser:appuser /build/pyproject.toml /build/uv.lock ./
|
| 76 |
+
COPY --chown=appuser:appuser backend/alembic.ini ./
|
| 77 |
+
COPY --chown=appuser:appuser backend/migrations/ ./migrations/
|
| 78 |
+
COPY --chown=appuser:appuser backend/generate_fernet_key.py backend/migrate.py backend/startup.py backend/setup.py backend/init_qdrant.py ./
|
| 79 |
+
COPY --chown=appuser:appuser backend/data/ ./data/
|
| 80 |
+
COPY --chown=appuser:appuser backend/app/ ./app/
|
| 81 |
|
| 82 |
# Create logs and cache directories
|
| 83 |
RUN mkdir -p /app/logs /app/.cache/huggingface && \
|
|
|
|
| 88 |
|
| 89 |
EXPOSE 7860
|
| 90 |
|
| 91 |
+
# Health check
|
| 92 |
+
HEALTHCHECK --interval=30s --timeout=10s --start-period=60s --retries=3 \
|
| 93 |
+
CMD curl -f http://localhost:7860/health || exit 1
|
| 94 |
+
|
| 95 |
# Run the application (migrations happen in startup lifespan)
|
| 96 |
CMD ["/opt/venv/bin/uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860"]
|