nurudeen8 commited on
Commit
1a2d514
·
1 Parent(s): 3ac49b3

update docker file

Browse files
Files changed (1) hide show
  1. 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 ./backend/alembic.ini ./
77
- COPY --chown=appuser:appuser ./backend/migrations/ ./backend/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/ ./backend/data/
80
- COPY --chown=appuser:appuser ./backend/app/ ./backend/app/
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"]