From 07e5eff73e653710661e0d9a7c0406b64efcc408 Mon Sep 17 00:00:00 2001 From: DavidVadnais Date: Fri, 7 Mar 2025 14:09:38 -1000 Subject: [PATCH 1/4] standalone postgresql v12-->v13 --- standalone/docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/standalone/docker-compose.yml b/standalone/docker-compose.yml index d797cc7c..8fc682c1 100644 --- a/standalone/docker-compose.yml +++ b/standalone/docker-compose.yml @@ -30,7 +30,7 @@ services: - postgres postgres: - image: postgres:12-bullseye + image: postgres:13-bullseye volumes: - postgres_data:/var/lib/postgresql/data env_file: docker.env From db5e67c7263c24490aa325f36a9535b6aaee6ccd Mon Sep 17 00:00:00 2001 From: DavidVadnais Date: Mon, 10 Mar 2025 12:07:32 -1000 Subject: [PATCH 2/4] upgrade yaml version to 3 and change postgresql version --- standalone/docker-compose.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/standalone/docker-compose.yml b/standalone/docker-compose.yml index 8fc682c1..4bf2075b 100644 --- a/standalone/docker-compose.yml +++ b/standalone/docker-compose.yml @@ -1,5 +1,3 @@ -version: '2' - # Define named volumes volumes: caddy_data: @@ -30,7 +28,7 @@ services: - postgres postgres: - image: postgres:13-bullseye + image: postgres:${POSTGRES_MAJOR_VERSION:-17}-bullseye volumes: - postgres_data:/var/lib/postgresql/data env_file: docker.env From 2786e41e4143de396d407bba0f34d01828b6f1dc Mon Sep 17 00:00:00 2001 From: DavidVadnais Date: Mon, 10 Mar 2025 15:23:18 -1000 Subject: [PATCH 3/4] Allow docker builds in non empty directories and fix packaging missing for python --- standalone/Dockerfile | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/standalone/Dockerfile b/standalone/Dockerfile index d67bb73d..518fb30f 100644 --- a/standalone/Dockerfile +++ b/standalone/Dockerfile @@ -1,3 +1,4 @@ +#see github workflows for docker build command FROM python:3.11-slim-bullseye LABEL src=https://github.com/django-helpdesk/django-helpdesk RUN apt-get update @@ -6,7 +7,10 @@ RUN apt-get install -yqq \ postgresql-client \ cron \ git -COPY . /opt/ + +COPY django-helpdesk /opt/django-helpdesk +RUN pip3 install --upgrade pip +RUN pip3 install packaging RUN pip3 install -r /opt/django-helpdesk/requirements.txt RUN pip3 install -r /opt/django-helpdesk/standalone/requirements.txt WORKDIR /opt/django-helpdesk @@ -15,4 +19,4 @@ RUN DJANGO_HELPDESK_SECRET_KEY=foo python3 standalone/manage.py collectstatic RUN echo "* * * * * root . /etc/env && /usr/local/bin/python3 /opt/django-helpdesk/standalone/manage.py get_email >> /var/log/cron.log 2>&1" > /etc/crontab RUN chmod 0644 /etc/crontab -ENTRYPOINT sh /opt/django-helpdesk/standalone/entrypoint.sh \ No newline at end of file +ENTRYPOINT sh /opt/django-helpdesk/standalone/entrypoint.sh From 888e59228fec395f8e481341a3dd2332dc210ad3 Mon Sep 17 00:00:00 2001 From: DavidVadnais Date: Tue, 11 Mar 2025 08:29:22 -1000 Subject: [PATCH 4/4] Update docs to use docker compose and document env var POSTGRES_MAJOR_VERSION --- docs/standalone.rst | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/docs/standalone.rst b/docs/standalone.rst index 4d3a3318..07fdb74b 100644 --- a/docs/standalone.rst +++ b/docs/standalone.rst @@ -5,7 +5,7 @@ You can find standalone docker images at `djangohelpdesk/standalone:latest `_ image with extra libraries needed to use the standalone image on cloud platforms such as AWS. You can find a full list of extra packages included in the extra's image `here `_. -Installation using docker-compose +Installation using docker compose ------------ 1. Clone the django-helpdesk repository: @@ -21,16 +21,22 @@ Installation using docker-compose cd django-helpdesk/standalone 3. Execute the installation script: - - .. code-block:: bash - - ./setup.sh + .. code-block:: bash + + ./setup.sh + + Set the POSTGRES major version if you are deploying to an existing POSTGRES instance other than the default shown within the docker-compose file. For example: + + .. code-block:: bash + + export POSTGRES_MAJOR_VERSION=15 + 4. Start the services: .. code-block:: bash - docker-compose up + docker compose up Creating an Admin User