From a9a3cf69c665b0a3097524d5815d5ba4a0332c77 Mon Sep 17 00:00:00 2001 From: pierregeeraert Date: Fri, 17 Jul 2026 15:14:16 +0100 Subject: [PATCH] restructuring --- .gitea/workflows/dockerfile_runner.yaml | 2 ++ .gitea/workflows/dockerfile_testing_runner.yaml | 2 +- dockerfile => infra/production/dockerfile | 7 +++++-- infra/production/entrypoint.sh | 5 +++++ {django_testing => infra/testing}/dockerfile | 1 - {django_testing => infra/testing}/entrypoint.sh | 0 6 files changed, 13 insertions(+), 4 deletions(-) rename dockerfile => infra/production/dockerfile (86%) create mode 100644 infra/production/entrypoint.sh rename {django_testing => infra/testing}/dockerfile (96%) rename {django_testing => infra/testing}/entrypoint.sh (100%) diff --git a/.gitea/workflows/dockerfile_runner.yaml b/.gitea/workflows/dockerfile_runner.yaml index 876514c..cd656a2 100644 --- a/.gitea/workflows/dockerfile_runner.yaml +++ b/.gitea/workflows/dockerfile_runner.yaml @@ -8,6 +8,7 @@ on: - 'django_testing/dockerfile' issue_comment: types: [created] + workflow_dispatch: # Enables the manual run UI button jobs: Explore-Gitea-Actions: @@ -82,6 +83,7 @@ jobs: - name: Build and push uses: docker/build-push-action@v6 with: + context: infra/production/ push: true build-args: | ALLOWED_HOSTS='django.tryton.geeraert.eu' diff --git a/.gitea/workflows/dockerfile_testing_runner.yaml b/.gitea/workflows/dockerfile_testing_runner.yaml index d934fa7..f03a0a0 100644 --- a/.gitea/workflows/dockerfile_testing_runner.yaml +++ b/.gitea/workflows/dockerfile_testing_runner.yaml @@ -46,7 +46,7 @@ jobs: - name: Build and push uses: docker/build-push-action@v6 with: - context: django_testing/ + context: infra/testing/ push: true build-args: | ALLOWED_HOSTS='django-testing.tryton.geeraert.eu' diff --git a/dockerfile b/infra/production/dockerfile similarity index 86% rename from dockerfile rename to infra/production/dockerfile index a98b496..5c0588b 100644 --- a/dockerfile +++ b/infra/production/dockerfile @@ -24,5 +24,8 @@ RUN pip install --cache-dir=/opt/hostedtoolcache/pip -r requirements.txt # Copy the rest of your application code (Changes frequently, invalidates subsequent cache) COPY . ./ -# CMD is the command run when the container starts -CMD [ "python","django_code/manage.py","runserver","0.0.0.0:8000" ] +COPY entrypoint.sh /code/entrypoint.sh +RUN chmod +x /code/entrypoint.sh + + +ENTRYPOINT ["/code/entrypoint.sh"] \ No newline at end of file diff --git a/infra/production/entrypoint.sh b/infra/production/entrypoint.sh new file mode 100644 index 0000000..3563687 --- /dev/null +++ b/infra/production/entrypoint.sh @@ -0,0 +1,5 @@ +#!/bin/bash + + +python django_code/manage.py runserver "0.0.0.0:8000" + diff --git a/django_testing/dockerfile b/infra/testing/dockerfile similarity index 96% rename from django_testing/dockerfile rename to infra/testing/dockerfile index fddcdf0..800cb9e 100644 --- a/django_testing/dockerfile +++ b/infra/testing/dockerfile @@ -30,4 +30,3 @@ EXPOSE 8000 ENTRYPOINT ["/code/entrypoint.sh"] -#Add text to trigger build again \ No newline at end of file diff --git a/django_testing/entrypoint.sh b/infra/testing/entrypoint.sh similarity index 100% rename from django_testing/entrypoint.sh rename to infra/testing/entrypoint.sh