File size: 1,750 Bytes
0fc06cf
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
c56286c
 
0fc06cf
 
 
 
 
 
c56286c
0fc06cf
c56286c
0fc06cf
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
58
59
60
61
62
63
64
65
66
# FROM python:3.10-slim

# # Set working directory
# WORKDIR /app

# # Copy everything into the container
# COPY . /app

# # Create a writable config directory for Matplotlib
# RUN mkdir -p /app/.config/matplotlib

# # Set environment variables for Hugging Face + Matplotlib
# ENV MPLCONFIGDIR=/app/.config/matplotlib \
#     PYTHONUNBUFFERED=1 \
#     PIP_NO_CACHE_DIR=1

# # Install dependencies
# RUN pip install --upgrade pip && \
#     pip install -r requirements.txt

# # Run setup script (e.g., download models)
# RUN chmod +x setup.sh && ./setup.sh

# # Expose port for Streamlit
# EXPOSE 7860

# # Command to run Streamlit app
# CMD ["streamlit", "run", "streamlit_app.py", "--server.port=7860", "--server.address=0.0.0.0"]


# Start from NVIDIA’s CUDA image with cuDNN support
FROM nvidia/cuda:12.1.1-cudnn8-runtime-ubuntu22.04

# Set working directory
WORKDIR /app

# Install Python, pip, git, and other essentials
RUN apt-get update && \

    apt-get install -y python3.10 python3.10-venv python3-pip git curl && \
    rm -rf /var/lib/apt/lists/*

# Copy everything into the container
COPY . /app

# Create a writable config directory for Matplotlib
RUN mkdir -p /app/.config/matplotlib

# Set environment variables
ENV MPLCONFIGDIR=/app/.config/matplotlib \
    PYTHONUNBUFFERED=1 \
    PIP_NO_CACHE_DIR=1

# Upgrade pip and install dependencies
RUN python3.10 -m pip install --upgrade pip && \

    pip install -r requirements.txt

# Run setup script (e.g., download models)
RUN chmod +x setup.sh && ./setup.sh

# Expose Streamlit port
EXPOSE 7860

# Command to run Streamlit app
CMD ["streamlit", "run", "test_app.py", "--server.port=7860", "--server.address=0.0.0.0"]