Hammad712 commited on
Commit
f09dd6e
·
verified ·
1 Parent(s): 0356e8f

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +7 -34
Dockerfile CHANGED
@@ -2,42 +2,15 @@ FROM python:3.9-slim
2
 
3
  WORKDIR /app
4
 
5
- # Install system dependencies
6
- RUN apt-get update && apt-get install -y \
7
- build-essential \
8
- libsndfile1 \
9
- && rm -rf /var/lib/apt/lists/*
10
-
11
- # Create cache directories with proper permissions
12
- RUN mkdir -p /cache/huggingface /cache/numba \
13
- && chmod -R 777 /cache
14
-
15
- # Set environment variables for caching
16
- ENV TRANSFORMERS_CACHE=/cache/huggingface
17
- ENV NUMBA_CACHE_DIR=/cache/numba
18
- ENV NUMBA_DISABLE_JIT=1
19
-
20
- # Copy requirements first for better caching
21
  COPY requirements.txt .
22
  RUN pip install --no-cache-dir -r requirements.txt
23
 
24
- # Copy application code
25
- COPY main.py .
26
-
27
- # Set environment variables
28
- ENV PORT=7860
29
- ENV MODEL_NAME="jonatasgrosman/wav2vec2-large-xlsr-53-arabic"
30
- # HF_TOKEN will be set at runtime
31
-
32
- # Make sure the work directory is accessible
33
- RUN chmod -R 777 /app
34
-
35
- # Run as non-root user for better security
36
- RUN useradd -m appuser
37
- USER appuser
38
 
39
- # Expose port
40
- EXPOSE 7860
41
 
42
- # Command to run the application
43
- CMD ["python", "main.py"]
 
2
 
3
  WORKDIR /app
4
 
5
+ # Install dependencies
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6
  COPY requirements.txt .
7
  RUN pip install --no-cache-dir -r requirements.txt
8
 
9
+ # Copy your application code
10
+ COPY . .
 
 
 
 
 
 
 
 
 
 
 
 
11
 
12
+ # Expose the port (if needed)
13
+ EXPOSE 7060
14
 
15
+ # Run the app with Uvicorn
16
+ CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7060"]