File size: 941 Bytes
50c44bd
 
 
 
 
 
 
a311858
 
cb3fc20
a311858
 
cb3fc20
50c44bd
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
295906b
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
# Use an official Python runtime as a parent image
FROM python:3.10-slim

# Set environment variables with correct syntax
ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1

# Set the Hugging Face home directory to a writable location
ENV HF_HOME=/app/cache

# Create the cache directory with proper permissions
RUN mkdir -p /app/cache && chown -R 1000:1000 /app/cache

# Set the working directory in the container
WORKDIR /app

# Copy the application code into the container
COPY . /app/

# Install system dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
    build-essential \
    libgl1-mesa-glx && \
    apt-get clean && rm -rf /var/lib/apt/lists/*

# Install Python dependencies
RUN pip install --no-cache-dir -r requirements.txt

# Expose the port that Streamlit runs on
EXPOSE 8501

# Command to run the application
CMD ["streamlit", "run", "main.py", "--server.port=7860", "--server.enableCORS=false"]