Spaces:
Sleeping
Sleeping
File size: 788 Bytes
894cea6 5a668b1 894cea6 5a668b1 894cea6 5a668b1 ac476a6 75c7ef7 0175c10 5a668b1 894cea6 5a668b1 9664235 75c7ef7 894cea6 9664235 5a668b1 3cf7129 |
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 |
# Use an official Python runtime as a parent image
FROM python:3.11-slim
# Install system dependencies
RUN apt-get update && apt-get install -y gcc
# Set the working directory to /app
WORKDIR /app
# Copy the requirements file and install dependencies
COPY requirements.txt .
RUN pip install --upgrade pip && pip install -r requirements.txt
# Create necessary directories with appropriate permissions
RUN mkdir -p /app/cache /app/uploads /app/data && chmod -R 777 /app/cache /app/uploads /app/data
RUN chmod -R 777 /app
# Copy the application code
COPY . .
# Set environment variables
ENV FLASK_APP=app.py \
FLASK_ENV=production
EXPOSE 7860
# Run the application using Gunicorn
CMD ["gunicorn", "-k", "eventlet", "-w", "1", "-b", "0.0.0.0:7860", "--timeout", "120", "app:app"] |