From 6610096c63079896dfde612743e5469f0b14cd5b Mon Sep 17 00:00:00 2001 From: "pierre-francois.duc" Date: Tue, 17 Jun 2025 21:26:50 +0200 Subject: [PATCH 1/2] Modify DB option in deploy --- deploy.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deploy.py b/deploy.py index d5ec5de3..275d6fbb 100644 --- a/deploy.py +++ b/deploy.py @@ -3,7 +3,7 @@ import warnings LOGS = {"gui": "app", "server": "nginx", "queues": "djangoq"} -DB = "POSTGRES" +DB = "postgres" parser = argparse.ArgumentParser( prog="python deploy.py", From 6866c72a68d7adc5bc23a9018ff9f8f3ccd0bcc5 Mon Sep 17 00:00:00 2001 From: "pierre-francois.duc" Date: Tue, 17 Jun 2025 21:53:30 +0200 Subject: [PATCH 2/2] Add Dockerfile for docker-compose --- .../app_postgres/Dockerfile-compose | 27 +++++++++++++++++++ app/initial_setup.sh | 3 ++- docker-compose-postgres.yml | 4 +-- 3 files changed, 31 insertions(+), 3 deletions(-) create mode 100644 app/compose/production/app_postgres/Dockerfile-compose diff --git a/app/compose/production/app_postgres/Dockerfile-compose b/app/compose/production/app_postgres/Dockerfile-compose new file mode 100644 index 00000000..96a5cb80 --- /dev/null +++ b/app/compose/production/app_postgres/Dockerfile-compose @@ -0,0 +1,27 @@ +FROM python:3.9.5 + +RUN echo POSTGRES +ENV APP_ROOT=/src +ENV CONFIG_ROOT=/config +ENV PYTHONDONTWRITEBYTECODE=1 +ENV PYTHONUNBUFFERED=1 + +RUN mkdir ${CONFIG_ROOT} +COPY requirements/base.txt ${CONFIG_ROOT}/base.txt +COPY requirements/production.txt ${CONFIG_ROOT}/production.txt + + +RUN pip install --upgrade pip \ + && pip install --no-cache-dir -r ${CONFIG_ROOT}/production.txt +WORKDIR ${APP_ROOT} + +ADD . ${APP_ROOT} + +COPY ./djangoq_setup.sh /djangoq_setup.sh +RUN chmod +x /djangoq_setup.sh + +RUN adduser appuser --system --no-create-home --shell /bin/sh \ + && chown -R appuser ${APP_ROOT} +USER appuser + +CMD ["python", "manage.py", "collectstatic"] diff --git a/app/initial_setup.sh b/app/initial_setup.sh index fdd27b76..2d66b098 100644 --- a/app/initial_setup.sh +++ b/app/initial_setup.sh @@ -3,6 +3,7 @@ python manage.py compilemessages python manage.py makemigrations users projects dashboard && \ python manage.py migrate && \ python manage.py update_assettype && \ +python /src/manage.py update_valuetype && \ python manage.py loaddata 'fixtures/multivector_fixture.json' && \ python manage.py collectstatic --no-input && \ -echo 'Completed initial setup of open-plan GUI app successfully!!' +echo 'Completed initial setup of open-plan GUI app successfully!!' \ No newline at end of file diff --git a/docker-compose-postgres.yml b/docker-compose-postgres.yml index ed2ddc33..2f777f3f 100644 --- a/docker-compose-postgres.yml +++ b/docker-compose-postgres.yml @@ -17,7 +17,7 @@ services: app_pg: build: context: ./app - dockerfile: ./compose/production/app_postgres/Dockerfile + dockerfile: ./compose/production/app_postgres/Dockerfile-compose container_name: django-open_plan_pg restart: always env_file: @@ -34,7 +34,7 @@ services: djangoq_pg: build: context: ./app - dockerfile: ./compose/production/app_postgres/Dockerfile + dockerfile: ./compose/production/app_postgres/Dockerfile-compose container_name: django-q-open_plan_pg restart: always env_file: