From 42dc64246c6ba91cff25c0b1f0e16384f7426675 Mon Sep 17 00:00:00 2001 From: fawney19 Date: Wed, 7 Jan 2026 16:38:46 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=20GUNICORN=5FWORKERS?= =?UTF-8?q?=20=E7=8E=AF=E5=A2=83=E5=8F=98=E9=87=8F=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile.app | 3 ++- docker-compose.build.yml | 6 ++++-- docker-compose.yml | 6 ++++-- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/Dockerfile.app b/Dockerfile.app index 2f4cefd..588477a 100644 --- a/Dockerfile.app +++ b/Dockerfile.app @@ -144,7 +144,8 @@ ENV PYTHONUNBUFFERED=1 \ PYTHONIOENCODING=utf-8 \ LANG=C.UTF-8 \ LC_ALL=C.UTF-8 \ - PORT=8084 + PORT=8084 \ + GUNICORN_WORKERS=4 EXPOSE 80 diff --git a/docker-compose.build.yml b/docker-compose.build.yml index 6d0010f..c0c6645 100644 --- a/docker-compose.build.yml +++ b/docker-compose.build.yml @@ -17,7 +17,7 @@ services: ports: - "${DB_PORT:-5432}:5432" healthcheck: - test: ["CMD-SHELL", "pg_isready -U postgres"] + test: [ "CMD-SHELL", "pg_isready -U postgres" ] interval: 5s timeout: 5s retries: 5 @@ -32,7 +32,7 @@ services: ports: - "${REDIS_PORT:-6379}:6379" healthcheck: - test: ["CMD", "redis-cli", "--raw", "incr", "ping"] + test: [ "CMD", "redis-cli", "--raw", "incr", "ping" ] interval: 5s timeout: 3s retries: 5 @@ -50,6 +50,8 @@ services: # 需要组合的变量 DATABASE_URL: postgresql://postgres:${DB_PASSWORD}@postgres:5432/aether REDIS_URL: redis://:${REDIS_PASSWORD}@redis:6379/0 + # Supervisor 需要的变量 + GUNICORN_WORKERS: ${GUNICORN_WORKERS:-4} # 容器级别设置 TZ: Asia/Shanghai PYTHONIOENCODING: utf-8 diff --git a/docker-compose.yml b/docker-compose.yml index 24e0c67..d0f32ee 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -13,7 +13,7 @@ services: volumes: - postgres_data:/var/lib/postgresql/data healthcheck: - test: ["CMD-SHELL", "pg_isready -U postgres"] + test: [ "CMD-SHELL", "pg_isready -U postgres" ] interval: 5s timeout: 5s retries: 5 @@ -26,7 +26,7 @@ services: volumes: - redis_data:/data healthcheck: - test: ["CMD", "redis-cli", "--raw", "incr", "ping"] + test: [ "CMD", "redis-cli", "--raw", "incr", "ping" ] interval: 5s timeout: 3s retries: 5 @@ -41,6 +41,8 @@ services: # 需要组合的变量 DATABASE_URL: postgresql://postgres:${DB_PASSWORD}@postgres:5432/aether REDIS_URL: redis://:${REDIS_PASSWORD}@redis:6379/0 + # Supervisor 需要的变量 + GUNICORN_WORKERS: ${GUNICORN_WORKERS:-4} # 容器级别设置 TZ: Asia/Shanghai PYTHONIOENCODING: utf-8