diff --git a/.gitea/workflows/dockerfile_runner.yaml b/.gitea/workflows/dockerfile_runner.yaml index 876514c..8affeca 100644 --- a/.gitea/workflows/dockerfile_runner.yaml +++ b/.gitea/workflows/dockerfile_runner.yaml @@ -5,9 +5,10 @@ on: branches: - main paths-ignore: - - 'django_testing/dockerfile' + - 'infra/production/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..fdde462 100644 --- a/.gitea/workflows/dockerfile_testing_runner.yaml +++ b/.gitea/workflows/dockerfile_testing_runner.yaml @@ -5,7 +5,7 @@ on: branches: - "testing" paths: - - 'django_testing/dockerfile' + - 'infra/testing/dockerfile' tags-ignore: - '*' workflow_dispatch: # Enables the manual run UI button @@ -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