Spaces:
Running
Running
File size: 1,039 Bytes
3f33752 03de8a4 3f33752 03de8a4 3f33752 03de8a4 3f33752 0c9e2d4 3f33752 c9db278 3f33752 |
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 |
# Use the official Python 3.10 slim image as the base
FROM python:3.10-slim
# Set environment variables
ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1
ENV TRANSFORMERS_CACHE=/app/.cache
# Set the working directory in the container
WORKDIR /app
# Copy the requirements file into the container
COPY requirements.txt /app/
# Install system dependencies
RUN apt-get update && apt-get install -y \
gcc \
&& rm -rf /var/lib/apt/lists/*
RUN mkdir -p /app/.cache && chmod -R 777 /app/.cache
# Install Python dependencies
RUN pip install --upgrade pip \
&& pip install --no-cache-dir -r requirements.txt
# Copy the application code into the container
COPY . /app/
# Expose the port Streamlit will run on
EXPOSE 7860
# Set Streamlit's configuration to run on all interfaces
ENV STREAMLIT_SERVER_ENABLE_CORS=false
ENV STREAMLIT_SERVER_ENABLE_XSRF_PROTECTION=false
ENV STREAMLIT_SERVER_ENABLEWEBBROWSER=false
ENV STREAMLIT_SERVER_PORT=7860
# Run the Streamlit app
CMD ["streamlit", "run", "genAI.py", "--server.port=7860"]
|