fix: 修复无法启动问题
This commit is contained in:
parent
c3b2838955
commit
ec4fe833b1
@ -26,6 +26,8 @@ class Command(BaseCommand):
|
|||||||
service = options.get('service')
|
service = options.get('service')
|
||||||
os.environ.setdefault('CELERY_NAME', ','.join(service))
|
os.environ.setdefault('CELERY_NAME', ','.join(service))
|
||||||
server_hostname = os.environ.get("SERVER_HOSTNAME")
|
server_hostname = os.environ.get("SERVER_HOSTNAME")
|
||||||
|
if os.getuid() == 0:
|
||||||
|
os.environ.setdefault('C_FORCE_ROOT', '1')
|
||||||
if not server_hostname:
|
if not server_hostname:
|
||||||
server_hostname = '%h'
|
server_hostname = '%h'
|
||||||
cmd = [
|
cmd = [
|
||||||
|
|||||||
@ -3,6 +3,7 @@ from django.db.models import TextChoices
|
|||||||
|
|
||||||
from .hands import *
|
from .hands import *
|
||||||
from .utils import ServicesUtil
|
from .utils import ServicesUtil
|
||||||
|
import os
|
||||||
|
|
||||||
|
|
||||||
class Services(TextChoices):
|
class Services(TextChoices):
|
||||||
@ -92,7 +93,7 @@ class BaseActionCommand(BaseCommand):
|
|||||||
'services', nargs='+', choices=Services.export_services_values(), help='Service',
|
'services', nargs='+', choices=Services.export_services_values(), help='Service',
|
||||||
)
|
)
|
||||||
parser.add_argument('-d', '--daemon', nargs="?", const=True)
|
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)
|
parser.add_argument('-f', '--force', nargs="?", const=True)
|
||||||
|
|
||||||
def initial_util(self, *args, **options):
|
def initial_util(self, *args, **options):
|
||||||
|
|||||||
@ -2,8 +2,6 @@ import logging
|
|||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
from django.conf import settings
|
|
||||||
|
|
||||||
from smartdoc.const import CONFIG, PROJECT_DIR
|
from smartdoc.const import CONFIG, PROJECT_DIR
|
||||||
|
|
||||||
try:
|
try:
|
||||||
@ -17,7 +15,7 @@ except ImportError as e:
|
|||||||
__version__ = 'Unknown'
|
__version__ = 'Unknown'
|
||||||
sys.exit(1)
|
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
|
HTTP_PORT = CONFIG.HTTP_LISTEN_PORT or 8080
|
||||||
DEBUG = CONFIG.DEBUG or False
|
DEBUG = CONFIG.DEBUG or False
|
||||||
|
|
||||||
|
|||||||
@ -1,3 +1,5 @@
|
|||||||
|
from django.conf import settings
|
||||||
|
|
||||||
from .base import BaseService
|
from .base import BaseService
|
||||||
from ..hands import *
|
from ..hands import *
|
||||||
|
|
||||||
|
|||||||
@ -48,7 +48,8 @@ ENV MAXKB_VERSION="${DOCKER_IMAGE_TAG} (build at ${BUILD_AT}, commit: ${GITHUB_C
|
|||||||
POSTGRES_USER=root \
|
POSTGRES_USER=root \
|
||||||
POSTGRES_PASSWORD=Password123@postgres \
|
POSTGRES_PASSWORD=Password123@postgres \
|
||||||
PIP_TARGET=/var/lib/postgresql/data/python-packages \
|
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
|
WORKDIR /opt/maxkb/app
|
||||||
COPY --from=stage-build /opt/maxkb /opt/maxkb
|
COPY --from=stage-build /opt/maxkb /opt/maxkb
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user