From cfcec66eedc78c3af393c84b09dfd17910821398 Mon Sep 17 00:00:00 2001 From: ydking0911 Date: Sun, 19 Oct 2025 14:52:16 +0900 Subject: [PATCH] =?UTF-8?q?[HOTFIX]=20gunicorn=20=EC=82=AC=EC=9A=A9?= =?UTF-8?q?=EC=9C=BC=EB=A1=9C=20=EC=84=B1=EB=8A=A5=20=ED=96=A5=EC=83=81=20?= =?UTF-8?q?=ED=85=8C=EC=8A=A4=ED=8A=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index bd97152..a13ca14 100644 --- a/Dockerfile +++ b/Dockerfile @@ -16,7 +16,8 @@ COPY requirements.txt . # Python 의존성 설치 RUN pip install --no-cache-dir --upgrade pip && \ - pip install --no-cache-dir -r requirements.txt + pip install --no-cache-dir -r requirements.txt && \ + pip install --no-cache-dir gunicorn RUN python -c "from sentence_transformers import SentenceTransformer; SentenceTransformer('kakaobank/kf-deberta-base')" @@ -30,6 +31,5 @@ EXPOSE 8000 ENV PYTHONPATH=/app ENV CHROMA_PERSIST_DIRECTORY=/tmp/chroma_db -# 애플리케이션 실행 -# CMD exec uvicorn app.main:app --host 0.0.0.0 --port ${PORT:-8000} -CMD ["/bin/sh", "-c", "uvicorn app.main:app --host 0.0.0.0 --port ${PORT:-8000}"] \ No newline at end of file +# 애플리케이션 실행 (gunicorn with uvicorn workers) +CMD ["gunicorn", "app.main:app", "-w", "8", "-k", "uvicorn.workers.UvicornWorker", "--bind", "0.0.0.0:8000", "--timeout", "300", "--keep-alive", "2", "--max-requests", "1000", "--max-requests-jitter", "100", "--worker-connections", "1000"] \ No newline at end of file