Spaces:
Sleeping
Sleeping
File size: 757 Bytes
6ff1f88 |
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 |
FROM python:3.9
WORKDIR /app
# Install system dependencies
RUN apt-get update && apt-get install -y \
build-essential \
&& rm -rf /var/lib/apt/lists/*
# Create a non-root user and switch to it
RUN useradd -m -u 1000 user
USER user
ENV PATH="/home/user/.local/bin:$PATH"
ENV PYTHONPATH="/app:$PYTHONPATH"
# Copy requirements first to leverage Docker cache
COPY --chown=user requirements.txt .
RUN pip install --no-cache-dir --upgrade -r requirements.txt
# Copy the application code
COPY --chown=user app.py .
COPY --chown=user apikeys.csv .
COPY --chown=user MODELS.csv .
COPY --chown=user utils.py .
COPY --chown=user core ./core
COPY --chown=user models ./models
# Expose the port
EXPOSE 7860
# Start the application
CMD ["python", "app.py"] |