From 05d19b88af7181aa4e7565e1a05af99c31cc6606 Mon Sep 17 00:00:00 2001 From: Ultradesu Date: Mon, 21 Jul 2025 17:20:08 +0300 Subject: [PATCH] Improve CI --- .github/workflows/main.yml | 2 ++ Dockerfile | 10 +++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index cab784c..7f11649 100755 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -41,6 +41,8 @@ jobs: with: platforms: linux/amd64,linux/arm64 push: true + cache-from: type=registry,ref=ultradesu/outfleet:buildcache + cache-to: type=registry,ref=ultradesu/outfleet:buildcache,mode=max build-args: | GIT_COMMIT=${{ steps.vars.outputs.sha_full }} GIT_COMMIT_SHORT=${{ steps.vars.outputs.sha_short }} diff --git a/Dockerfile b/Dockerfile index 6fd8f1c..fea50f8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,9 +14,17 @@ ENV BRANCH_NAME=${BRANCH_NAME} WORKDIR /app +# Install system dependencies first (this layer will be cached) +RUN apk update && apk add git + +# Copy and install Python dependencies (this layer will be cached when requirements.txt doesn't change) COPY ./requirements.txt . -RUN apk update && apk add git && pip install --no-cache-dir -r requirements.txt +RUN pip install --no-cache-dir -r requirements.txt + +# Copy the rest of the application code (this layer will change frequently) COPY . . + +# Run collectstatic RUN python manage.py collectstatic --noinput CMD [ "python", "./manage.py", "runserver", "0.0.0.0:8000" ]