diff --git a/Dockerfile b/Dockerfile index 75d1b38..f2cad06 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,16 +1,8 @@ -FROM python:3.12.3-slim-bullseye -ENV PYTHONDONTWRITEBYTECODE 1 -ENV PYTHONUNBUFFERED 1 +FROM tiangolo/meinheld-gunicorn:latest -RUN pip install pip pipenv --upgrade -RUN mkdir -p /usr/src/app -WORKDIR /usr/src/app +COPY ./requirements.txt /app/requirements.txt +RUN pip install pip --upgrade && pip install --no-cache-dir --upgrade -r /app/requirements.txt -COPY ./Pipfile /usr/src/app -RUN pipenv lock && pipenv sync +COPY . /app -COPY . /usr/src/app - -EXPOSE 8000 -COPY ./runserver.sh /usr/local/bin/ -CMD ["pipenv", "run", "sh", "runserver.sh"] +ENV APP_MODULE="xivpet.wsgi:application" diff --git a/Pipfile b/Pipfile deleted file mode 100644 index ba1d554..0000000 --- a/Pipfile +++ /dev/null @@ -1,13 +0,0 @@ -[[source]] -name = "pypi" -url = "https://pypi.org/simple" -verify_ssl = true - -[packages] -asgiref = "==3.8.1" -sqlparse = "==0.5.0" -gunicorn = "*" -django = "*" - -[requires] -python_version = "3.12" diff --git a/Pipfile.lock b/Pipfile.lock deleted file mode 100644 index 67a0a37..0000000 --- a/Pipfile.lock +++ /dev/null @@ -1,65 +0,0 @@ -{ - "_meta": { - "hash": { - "sha256": "329ea0c3d5d704dd19dfef270400f65d4294fab10256abd78a429c77eff95da4" - }, - "pipfile-spec": 6, - "requires": { - "python_version": "3.12" - }, - "sources": [ - { - "name": "pypi", - "url": "https://pypi.org/simple", - "verify_ssl": true - } - ] - }, - "default": { - "asgiref": { - "hashes": [ - "sha256:3e1e3ecc849832fe52ccf2cb6686b7a55f82bb1d6aee72a58826471390335e47", - "sha256:c343bd80a0bec947a9860adb4c432ffa7db769836c64238fc34bdc3fec84d590" - ], - "index": "pypi", - "markers": "python_version >= '3.8'", - "version": "==3.8.1" - }, - "django": { - "hashes": [ - "sha256:8363ac062bb4ef7c3f12d078f6fa5d154031d129a15170a1066412af49d30905", - "sha256:ff1b61005004e476e0aeea47c7f79b85864c70124030e95146315396f1e7951f" - ], - "index": "pypi", - "markers": "python_version >= '3.10'", - "version": "==5.0.6" - }, - "gunicorn": { - "hashes": [ - "sha256:350679f91b24062c86e386e198a15438d53a7a8207235a78ba1b53df4c4378d9", - "sha256:4a0b436239ff76fb33f11c07a16482c521a7e09c1ce3cc293c2330afe01bec63" - ], - "index": "pypi", - "markers": "python_version >= '3.7'", - "version": "==22.0.0" - }, - "packaging": { - "hashes": [ - "sha256:2ddfb553fdf02fb784c234c7ba6ccc288296ceabec964ad2eae3777778130bc5", - "sha256:eb82c5e3e56209074766e6885bb04b8c38a0c015d0a30036ebe7ece34c9989e9" - ], - "markers": "python_version >= '3.7'", - "version": "==24.0" - }, - "sqlparse": { - "hashes": [ - "sha256:714d0a4932c059d16189f58ef5411ec2287a4360f17cdd0edd2d09d4c5087c93", - "sha256:c204494cd97479d0e39f28c93d46c0b2d5959c7b9ab904762ea6c7af211c8663" - ], - "index": "pypi", - "markers": "python_version >= '3.8'", - "version": "==0.5.0" - } - }, - "develop": {} -} diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..0093841 --- /dev/null +++ b/requirements.txt @@ -0,0 +1 @@ +django>=4.2,<5.0 diff --git a/runserver.sh b/runserver.sh deleted file mode 100644 index 7610f62..0000000 --- a/runserver.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh -python manage.py migrate -python manage.py createsuperuser --username aly --email aly@aly.pet --noinput -gunicorn xivpet.wsgi:application --bind=0.0.0.0:8000 diff --git a/xivpet/settings.py b/xivpet/settings.py index 8927d84..dbd2def 100644 --- a/xivpet/settings.py +++ b/xivpet/settings.py @@ -26,7 +26,7 @@ SECRET_KEY = os.environ.get("SECRET_KEY") # SECURITY WARNING: don't run with debug turned on in production! DEBUG = bool(os.environ.get("DEBUG")) -ALLOWED_HOSTS = ["captain.captain.localhost", "127.0.0.1"] +ALLOWED_HOSTS = ["*"] # Application definition