testing-new-project / Dockerfile
Charan5775's picture
Update Dockerfile
79915db verified
raw
history blame contribute delete
620 Bytes
FROM python:3.9
RUN --mount=type=secret,id=Access_key,mode=0444,required=true \
git clone $(cat /run/secrets/Access_key) /app
WORKDIR /app
# Install Python dependencies
RUN pip install --no-cache-dir --upgrade -r requirements.txt
# Ensure server_storage directory exists and has correct permissions
RUN mkdir -p /app/server_storage && chmod -R 777 /app/server_storage
# Set environment variables for Gunicorn
ENV GUNICORN_CMD_ARGS="-b 0.0.0.0:7860 --timeout 300 --workers 2 --threads 4"
# Start Gunicorn with the correct application path
CMD ["gunicorn", "server.main:app", "-k", "uvicorn.workers.UvicornWorker"]