Spaces:
Sleeping
Sleeping
FROM python:3.10 | |
# Create a non-root user | |
RUN addgroup --system appgroup && adduser --system --ingroup appgroup appuser | |
# Set the working directory | |
WORKDIR /app | |
# Copy the requirements file and install dependencies | |
COPY requirements.txt . | |
RUN pip install -r requirements.txt | |
# Copy the rest of the application code | |
COPY . . | |
# Set environment variables | |
ENV PYTHONDONTWRITEBYTECODE=1 | |
ENV PYTHONUNBUFFERED=1 | |
# Expose the port | |
EXPOSE 7860 | |
# Run the application | |
CMD ["gunicorn", "app:server", "-b", "0.0.0.0:7860", "--workers=1"] | |