diff --git a/Dockerfile b/Dockerfile index 306c4a2..d9ff83d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -16,5 +16,4 @@ RUN pip install --no-cache-dir -r requirements.txt COPY . /app/ EXPOSE 8111 - -CMD ["gunicorn", "--bind", "0.0.0.0:8111", "lmsege.wsgi:application"] +CMD ["gunicorn", "--bind", "0.0.0.0:8111", "--chdir", "/app/lmsege", "lmsege.wsgi:application"] diff --git a/lmsege/lmsege/settings.py b/lmsege/lmsege/settings.py index ec81fae..eb18e33 100644 --- a/lmsege/lmsege/settings.py +++ b/lmsege/lmsege/settings.py @@ -20,7 +20,9 @@ BASE_DIR = Path(__file__).resolve().parent.parent env = environ.Env( DEBUG=(bool, False) ) -environ.Env.read_env(os.path.join(BASE_DIR.parent, '.env')) +env_file = os.path.join(BASE_DIR.parent, '.env') +if os.path.exists(env_file): + environ.Env.read_env(env_file) # Quick-start development settings - unsuitable for production @@ -127,10 +129,10 @@ USE_TZ = True # Static files (CSS, JavaScript, Images) # https://docs.djangoproject.com/en/6.1/howto/static-files/ -STATIC_URL = 'static/' +STATIC_URL = '/static/' STATIC_ROOT = BASE_DIR / 'staticfiles' -MEDIA_URL = 'media/' +MEDIA_URL = '/media/' MEDIA_ROOT = BASE_DIR / 'media'