sujoy0011 commited on
Commit
a0969d9
·
verified ·
1 Parent(s): 5a000dd

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +63 -58
Dockerfile CHANGED
@@ -1,58 +1,63 @@
1
- # Use Python 3.11 slim image
2
- FROM python:3.11-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
-
13
- # Install system dependencies
14
- RUN apt-get update && apt-get install -y \
15
- gcc \
16
- g++ \
17
- curl \
18
- ffmpeg \
19
- libpq-dev \
20
- git \
21
- && rm -rf /var/lib/apt/lists/*
22
-
23
- # Copy requirements first (for better Docker layer caching)
24
- COPY requirements.txt .
25
-
26
- # Install Python dependencies
27
- RUN pip install --upgrade pip && \
28
- pip install -r requirements.txt
29
-
30
- # Copy entire application
31
- COPY . .
32
-
33
- # Create necessary directories
34
- RUN mkdir -p /app/storage/resumes && \
35
- mkdir -p /app/alembic/versions
36
-
37
- # Create __init__.py files if missing (ensure Python recognizes directories)
38
- RUN touch app/__init__.py \
39
- app/api/__init__.py \
40
- app/api/v1/__init__.py \
41
- app/api/v1/endpoints/__init__.py \
42
- app/models/__init__.py \
43
- app/schemas/__init__.py \
44
- app/services/__init__.py \
45
- app/agents/__init__.py \
46
- app/tools/__init__.py \
47
- app/core/__init__.py \
48
- app/utils/__init__.py
49
-
50
- # Expose port
51
- EXPOSE 8000
52
-
53
- # Health check
54
- HEALTHCHECK --interval=30s --timeout=10s --start-period=40s --retries=3 \
55
- CMD curl -f http://localhost:8000/health || exit 1
56
-
57
- # Run the application using run.py
58
- CMD ["python", "run.py"]
 
 
 
 
 
 
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"]