Spaces:
Runtime error
Runtime error
Update Dockerfile
Browse files- Dockerfile +63 -58
Dockerfile
CHANGED
|
@@ -1,58 +1,63 @@
|
|
| 1 |
-
# Use Python 3.
|
| 2 |
-
FROM python:3.
|
| 3 |
-
|
| 4 |
-
# Set working directory
|
| 5 |
-
WORKDIR /app
|
| 6 |
-
|
| 7 |
-
# Set environment variables
|
| 8 |
-
ENV PYTHONUNBUFFERED=1 \
|
| 9 |
-
PYTHONDONTWRITEBYTECODE=1 \
|
| 10 |
-
PIP_NO_CACHE_DIR=1 \
|
| 11 |
-
PIP_DISABLE_PIP_VERSION_CHECK=1
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
app/
|
| 40 |
-
app/
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
app/
|
| 45 |
-
app/
|
| 46 |
-
app/
|
| 47 |
-
app/
|
| 48 |
-
app/
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Use Python 3.13 slim image
|
| 2 |
+
FROM python:3.13-slim
|
| 3 |
+
|
| 4 |
+
# Set working directory
|
| 5 |
+
WORKDIR /app
|
| 6 |
+
|
| 7 |
+
# Set environment variables
|
| 8 |
+
ENV PYTHONUNBUFFERED=1 \
|
| 9 |
+
PYTHONDONTWRITEBYTECODE=1 \
|
| 10 |
+
PIP_NO_CACHE_DIR=1 \
|
| 11 |
+
PIP_DISABLE_PIP_VERSION_CHECK=1 \
|
| 12 |
+
HOME=/app \
|
| 13 |
+
WHISPER_CACHE_DIR=/app/.cache/whisper
|
| 14 |
+
|
| 15 |
+
# Install system dependencies
|
| 16 |
+
RUN apt-get update && apt-get install -y \
|
| 17 |
+
gcc \
|
| 18 |
+
g++ \
|
| 19 |
+
curl \
|
| 20 |
+
ffmpeg \
|
| 21 |
+
libpq-dev \
|
| 22 |
+
git \
|
| 23 |
+
&& rm -rf /var/lib/apt/lists/*
|
| 24 |
+
|
| 25 |
+
# Copy requirements
|
| 26 |
+
COPY requirements.txt .
|
| 27 |
+
|
| 28 |
+
# Install Python dependencies
|
| 29 |
+
RUN pip install --upgrade pip && \
|
| 30 |
+
pip install -r requirements.txt
|
| 31 |
+
|
| 32 |
+
# Copy application code
|
| 33 |
+
COPY . .
|
| 34 |
+
|
| 35 |
+
# Create necessary directories with proper permissions
|
| 36 |
+
RUN mkdir -p /app/storage/resumes && \
|
| 37 |
+
mkdir -p /app/.cache/whisper && \
|
| 38 |
+
mkdir -p /app/alembic/versions && \
|
| 39 |
+
chmod -R 755 /app/storage && \
|
| 40 |
+
chmod -R 755 /app/.cache
|
| 41 |
+
|
| 42 |
+
# Create __init__.py files if missing
|
| 43 |
+
RUN touch app/__init__.py \
|
| 44 |
+
app/api/__init__.py \
|
| 45 |
+
app/api/v1/__init__.py \
|
| 46 |
+
app/api/v1/endpoints/__init__.py \
|
| 47 |
+
app/models/__init__.py \
|
| 48 |
+
app/schemas/__init__.py \
|
| 49 |
+
app/services/__init__.py \
|
| 50 |
+
app/agents/__init__.py \
|
| 51 |
+
app/tools/__init__.py \
|
| 52 |
+
app/core/__init__.py \
|
| 53 |
+
app/utils/__init__.py
|
| 54 |
+
|
| 55 |
+
# Expose port
|
| 56 |
+
EXPOSE 8000
|
| 57 |
+
|
| 58 |
+
# Health check
|
| 59 |
+
HEALTHCHECK --interval=30s --timeout=10s --start-period=40s --retries=3 \
|
| 60 |
+
CMD curl -f http://localhost:8000/health || exit 1
|
| 61 |
+
|
| 62 |
+
# Run the application
|
| 63 |
+
CMD ["python", "run.py"]
|