port
This commit is contained in:
parent
47eb1c84ac
commit
46c5e23dc6
3 changed files with 14 additions and 17 deletions
11
Dockerfile
11
Dockerfile
|
@ -1,5 +1,8 @@
|
||||||
FROM python:3.12.3
|
FROM python:3.12.3-slim-bullseye
|
||||||
RUN pip install pipenv --upgrade
|
ENV PYTHONDONTWRITEBYTECODE 1
|
||||||
|
ENV PYTHONUNBUFFERED 1
|
||||||
|
|
||||||
|
RUN pip install pip pipenv --upgrade
|
||||||
RUN mkdir -p /usr/src/app
|
RUN mkdir -p /usr/src/app
|
||||||
WORKDIR /usr/src/app
|
WORKDIR /usr/src/app
|
||||||
|
|
||||||
|
@ -8,6 +11,6 @@ RUN pipenv lock && pipenv sync
|
||||||
|
|
||||||
COPY . /usr/src/app
|
COPY . /usr/src/app
|
||||||
|
|
||||||
EXPOSE 80
|
EXPOSE 8000
|
||||||
COPY ./runserver.sh /usr/local/bin/
|
COPY ./runserver.sh /usr/local/bin/
|
||||||
CMD ["sh", "runserver.sh"]
|
CMD ["pipenv", "runserver.sh"]
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
python manage.py migrate
|
python manage.py migrate
|
||||||
python manage.py makesuper
|
python manage.py createsuperuser --username aly --email aly@aly.pet --noinput
|
||||||
gunicorn demo.wsgi --bind=0.0.0.0:80
|
gunicorn xivpet.wsgi:application --bind=0.0.0.0:8000
|
||||||
|
|
|
@ -11,9 +11,7 @@ https://docs.djangoproject.com/en/5.0/ref/settings/
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
import environ
|
import os
|
||||||
|
|
||||||
env = environ.Env()
|
|
||||||
|
|
||||||
# Build paths inside the project like this: BASE_DIR / 'subdir'.
|
# Build paths inside the project like this: BASE_DIR / 'subdir'.
|
||||||
BASE_DIR = Path(__file__).resolve().parent.parent
|
BASE_DIR = Path(__file__).resolve().parent.parent
|
||||||
|
@ -23,12 +21,12 @@ BASE_DIR = Path(__file__).resolve().parent.parent
|
||||||
# See https://docs.djangoproject.com/en/5.0/howto/deployment/checklist/
|
# See https://docs.djangoproject.com/en/5.0/howto/deployment/checklist/
|
||||||
|
|
||||||
# SECURITY WARNING: keep the secret key used in production secret!
|
# SECURITY WARNING: keep the secret key used in production secret!
|
||||||
SECRET_KEY = env("SECRET_KEY")
|
SECRET_KEY = os.environ.get("SECRET_KEY")
|
||||||
|
|
||||||
# SECURITY WARNING: don't run with debug turned on in production!
|
# SECURITY WARNING: don't run with debug turned on in production!
|
||||||
DEBUG = env.bool("DEBUG")
|
DEBUG = bool(os.environ.get("DEBUG"))
|
||||||
|
|
||||||
ALLOWED_HOSTS = []
|
ALLOWED_HOSTS = ["captain.captain.localhost", "127.0.0.1"]
|
||||||
|
|
||||||
|
|
||||||
# Application definition
|
# Application definition
|
||||||
|
@ -118,11 +116,7 @@ USE_TZ = True
|
||||||
# Static files (CSS, JavaScript, Images)
|
# Static files (CSS, JavaScript, Images)
|
||||||
# https://docs.djangoproject.com/en/5.0/howto/static-files/
|
# https://docs.djangoproject.com/en/5.0/howto/static-files/
|
||||||
|
|
||||||
STATIC_URL = '/static/'
|
STATIC_URL = 'static/'
|
||||||
STATICFILES_DIRS = [os.path.join(BASE_DIR, 'static_files')]
|
|
||||||
STATIC_ROOT = os.path.join(BASE_DIR, 'static_root')
|
|
||||||
MEDIA_URL = '/media/'
|
|
||||||
MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
|
|
||||||
|
|
||||||
# Default primary key field type
|
# Default primary key field type
|
||||||
# https://docs.djangoproject.com/en/5.0/ref/settings/#default-auto-field
|
# https://docs.djangoproject.com/en/5.0/ref/settings/#default-auto-field
|
||||||
|
|
Loading…
Reference in a new issue