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..0fd4c13 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 = ["*"] @@ -24,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