mirror of
https://github.com/1Panel-dev/MaxKB.git
synced 2025-12-26 01:33:05 +00:00
fix: 修复无法启动问题
This commit is contained in:
parent
c3b2838955
commit
ec4fe833b1
|
|
@ -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 = [
|
||||
|
|
|
|||
|
|
@ -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):
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
from django.conf import settings
|
||||
|
||||
from .base import BaseService
|
||||
from ..hands import *
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue