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