From b5ebff0d36dd7ced89888cd3d6c61aa8e6d6bde1 Mon Sep 17 00:00:00 2001 From: csae8092 Date: Thu, 4 Jan 2024 10:37:41 +0100 Subject: [PATCH 1/2] image builds locally ... --- .dockerignore | 3 +++ Dockerfile | 5 +++-- pmb/settings.py | 2 ++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.dockerignore b/.dockerignore index a30fc96..e18d2af 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,7 +1,10 @@ myenv env +venv +staticfiles db.sqlite3 cover +htmlcov media/uploads/*.rdf media/uploads/*.ttl .secret diff --git a/Dockerfile b/Dockerfile index 690e749..4424e9d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,7 @@ -FROM python:3.10 +FROM python:3.11-buster RUN apt-get update -y && apt-get upgrade -y -RUN apt-get install nginx g++ gcc libmariadb-dev vim cron tzdata -y +RUN apt-get install postgresql-common libpq-dev nginx g++ gcc vim cron tzdata -y RUN ln -sf /dev/stdout /var/log/nginx/access.log \ && ln -sf /dev/stderr /var/log/nginx/error.log ENV TZ="Europe/Vienna" @@ -11,6 +11,7 @@ COPY nginx.default /etc/nginx/sites-available/default RUN mkdir -p /opt/app COPY requirements.txt /opt/app/ RUN pip install -U pip --no-cache-dir && pip install -r /opt/app/requirements.txt --no-cache-dir +RUN pip install gunicorn COPY . /opt/app WORKDIR /opt/app RUN chown -R www-data:www-data /opt/app && chmod -R 755 /opt/app/media diff --git a/pmb/settings.py b/pmb/settings.py index 4316136..da2de4a 100644 --- a/pmb/settings.py +++ b/pmb/settings.py @@ -14,6 +14,8 @@ # SECURITY WARNING: don't run with debug turned on in production! if os.environ.get("DEBUG"): DEBUG = True +else: + DEBUG = False ALLOWED_HOSTS = ["*"] From 65594f0cb03c17e388fede4a73d9b6dbcd9c7b1b Mon Sep 17 00:00:00 2001 From: csae8092 Date: Thu, 4 Jan 2024 10:49:20 +0100 Subject: [PATCH 2/2] override needed for docker --- pmb/settings.py | 1 + requirements.txt | 1 + 2 files changed, 2 insertions(+) diff --git a/pmb/settings.py b/pmb/settings.py index da2de4a..0fd4c13 100644 --- a/pmb/settings.py +++ b/pmb/settings.py @@ -26,6 +26,7 @@ # Application definition INSTALLED_APPS = [ + "apis_override_select2js", "dal", "dal_select2", "django_extensions", diff --git a/requirements.txt b/requirements.txt index a58e0b0..3086f35 100644 --- a/requirements.txt +++ b/requirements.txt @@ -3,6 +3,7 @@ acdh_geonames_utils acdh-id-reconciler>=0.2,<1 acdh-tei-pyutils>=0.34,<1 acdh-wikidata-pyutils>=0.2.1,<1 +apis-override-select2js==0.1 Django>4.1,<6 django-admin-csvexport django-autocomplete-light