avoiding git clone within the dockerfile
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 7s

This commit is contained in:
2026-07-28 13:38:41 +01:00
parent 31179d99de
commit a1d7d8005d
2 changed files with 20 additions and 3 deletions
+15
View File
@@ -1,5 +1,20 @@
#!/bin/bash
python django_code/manage.py makemigrations
python django_code/manage.py makemigrations redirect
python django_code/manage.py makemigrations cloudmanager
python django_code/manage.py makemigrations simpsons
python django_code/manage.py makemigrations job
python django_code/manage.py makemigrations telegram
python django_code/manage.py makemigrations podcast
python django_code/manage.py migrate
python django_code/manage.py migrate --database=cloudmanager_db
python django_code/manage.py migrate --database=simpsons_db
python django_code/manage.py migrate --database=redirect_db
python django_code/manage.py migrate --database=job_db
python django_code/manage.py migrate --database=telegram_db
python django_code/manage.py migrate --database=podcast_db
python django_code/manage.py runserver "0.0.0.0:8000"
+5 -3
View File
@@ -15,10 +15,9 @@ RUN apt-get update && \
apt-get install -y git nano && \
rm -rf /var/lib/apt/lists/*
# Clone the project
RUN git clone -b testing https://gitea.tryton.geeraert.eu/pi-ux-ce/Django_kube.git
RUN cat Django_kube/requirements.txt
# Copy only the requirements file first (Changes infrequently)
COPY requirements.txt ./
RUN pip install --cache-dir=/opt/hostedtoolcache/pip --upgrade pip
RUN pip list --cache-dir=/opt/hostedtoolcache/pip --outdated
@@ -26,6 +25,9 @@ RUN pip install --cache-dir=/opt/hostedtoolcache/pip --upgrade wheel
RUN pip install --cache-dir=/opt/hostedtoolcache/pip --upgrade setuptools
RUN pip install --cache-dir=/opt/hostedtoolcache/pip -r Django_kube/requirements.txt
# Copy the rest of your application code (Changes frequently, invalidates subsequent cache)
COPY . ./
COPY infra/testing/entrypoint.sh /code/entrypoint.sh
RUN chmod +x /code/entrypoint.sh