fix: 修复无法启动问题
Some checks are pending
sync2gitee / repo-sync (push) Waiting to run
Typos Check / Spell Check with Typos (push) Waiting to run

This commit is contained in:
shaohuzhang1 2024-08-21 18:37:47 +08:00 committed by shaohuzhang1
parent c3b2838955
commit ec4fe833b1
5 changed files with 9 additions and 5 deletions

View File

@ -26,6 +26,8 @@ class Command(BaseCommand):
service = options.get('service')
os.environ.setdefault('CELERY_NAME', ','.join(service))
server_hostname = os.environ.get("SERVER_HOSTNAME")
if os.getuid() == 0:
os.environ.setdefault('C_FORCE_ROOT', '1')
if not server_hostname:
server_hostname = '%h'
cmd = [

View File

@ -3,6 +3,7 @@ from django.db.models import TextChoices
from .hands import *
from .utils import ServicesUtil
import os
class Services(TextChoices):
@ -92,7 +93,7 @@ class BaseActionCommand(BaseCommand):
'services', nargs='+', choices=Services.export_services_values(), help='Service',
)
parser.add_argument('-d', '--daemon', nargs="?", const=True)
parser.add_argument('-w', '--worker', type=int, nargs="?", default=4)
parser.add_argument('-w', '--worker', type=int, nargs="?", default=3 if os.cpu_count() > 3 else os.cpu_count())
parser.add_argument('-f', '--force', nargs="?", const=True)
def initial_util(self, *args, **options):

View File

@ -2,8 +2,6 @@ import logging
import os
import sys
from django.conf import settings
from smartdoc.const import CONFIG, PROJECT_DIR
try:
@ -17,7 +15,7 @@ except ImportError as e:
__version__ = 'Unknown'
sys.exit(1)
HTTP_HOST = CONFIG.HTTP_BIND_HOST or '127.0.0.1'
HTTP_HOST = '0.0.0.0'
HTTP_PORT = CONFIG.HTTP_LISTEN_PORT or 8080
DEBUG = CONFIG.DEBUG or False

View File

@ -1,3 +1,5 @@
from django.conf import settings
from .base import BaseService
from ..hands import *

View File

@ -48,7 +48,8 @@ ENV MAXKB_VERSION="${DOCKER_IMAGE_TAG} (build at ${BUILD_AT}, commit: ${GITHUB_C
POSTGRES_USER=root \
POSTGRES_PASSWORD=Password123@postgres \
PIP_TARGET=/var/lib/postgresql/data/python-packages \
PYTHONPATH=/var/lib/postgresql/data/python-packages
PYTHONPATH=/var/lib/postgresql/data/python-packages \
PYTHONUNBUFFERED=1
WORKDIR /opt/maxkb/app
COPY --from=stage-build /opt/maxkb /opt/maxkb