File size: 1,294 Bytes
58d52e0
52a80db
43317b5
d172d27
43317b5
 
fe38529
 
 
 
 
 
97c1dc4
 
 
 
 
 
52a80db
0e8f1bc
52a80db
0e8f1bc
0fd692d
 
 
 
 
 
 
 
e02851f
43317b5
97c1dc4
d172d27
ac7dcdd
d172d27
43317b5
4629ff1
 
9f1a73b
 
 
 
4629ff1
 
0fd692d
 
 
 
97c1dc4
 
43317b5
0fd692d
4629ff1
43317b5
97c1dc4
0fd692d
1
2
3
4
5
6
7
8
9
10
11
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
FROM python:3.9-slim


# Set working directory
WORKDIR /app

ENV HOME=/app

RUN mkdir -p /app/.cache && chmod -R 777 /app/.cache
ENV XDG_CACHE_HOME=/app/.cache


# Install required system packages
RUN apt-get update && apt-get install -y \
    libgl1-mesa-glx \
    libportaudio2 \
    portaudio19-dev \
    ffmpeg \
    build-essential \
    && rm -rf /var/lib/apt/lists/*

    
# Create necessary directories
RUN mkdir -p uploads static
RUN mkdir -p /var/cache/fontconfig && chmod 777 /var/cache/fontconfig

# Set environment variables
ENV MPLCONFIGDIR=/tmp
ENV YOLO_CONFIG_DIR=/tmp
ENV FONTCONFIG_PATH=/var/cache/fontconfig


# Install Python dependencies
COPY Web_app/requirements.txt ./requirements.txt
RUN pip install --upgrade pip
RUN pip install --no-cache-dir -r requirements.txt

# After installing requirements
RUN pip uninstall -y torch torchvision && \
    pip install --upgrade --force-reinstall --no-cache-dir torch==2.3.0 torchvision==0.18.0


RUN pip freeze | grep -E 'torch|torchvision'


# Explicitly install OpenAI Whisper
RUN pip install openai-whisper==20231117
RUN python -c "import whisper; print('Whisper installed successfully')"

# Copy application code
COPY Web_app .

# Expose the port for Hugging Face
EXPOSE 5000

# Command to run the app
CMD ["python", "app.py"]