Spaces:
Sleeping
Sleeping
File size: 530 Bytes
0b5541b | 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 | # Use an official Python runtime as a parent image
FROM python:3.11-slim
# Create and switch to a new user
RUN useradd -m -u 1000 user
USER user
ENV PATH="/home/user/.local/bin:$PATH"
# Set work directory
WORKDIR /app
# Copy requirements
COPY --chown=user ./requirements.txt requirements.txt
# Install Python dependencies
RUN pip install --no-cache-dir --upgrade -r requirements.txt
# Copy application code
COPY --chown=user . /app
# Expose port for Flask
EXPOSE 7860
# Start the application
CMD ["python", "ai_server.py"]
|