Commit 58da27d3 authored by Vũ Hoàng Anh's avatar Vũ Hoàng Anh

Update Dockerfile.prod

parent bacfd1d4
FROM python:3.11-slim
FROM python:3.11-slim
WORKDIR /app
WORKDIR /app
ENV PYTHONUNBUFFERED=1
ENV PYTHONUNBUFFERED=1 ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONDONTWRITEBYTECODE=1 ENV ENV=development
ENV ENV=development
COPY requirements.txt .
COPY requirements.txt . RUN pip install -r requirements.txt
RUN pip install -r requirements.txt
COPY . .
COPY . .
# Expose port 5000 (Port chạy server)
# Expose port 5000 (Port chạy server) EXPOSE 5000
EXPOSE 5000
CMD gunicorn server:app --workers $(( 2 * $(nproc) + 1 )) --worker-class uvicorn.workers.UvicornWorker --bind 0.0.0.0:5000 --timeout 60
# Tự động tính số worker = (Số Core * 2) + 1 để tận dụng tối đa CPU
CMD gunicorn server:app --workers $(( 2 * $(nproc) + 1 )) --worker-class uvicorn.workers.UvicornWorker --bind 0.0.0.0:5000 --timeout 60
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment