invidious-companion-patches/patches/0015-ci-improve-container-image-build-times.patch
Fijxu 24b0b27965
All checks were successful
Build and Push Docker Image / build-and-push (push) Successful in 1m14s
add patch option-to-only-use-http-1.1-client-on-videoplayback-
2025-04-21 17:01:07 -04:00

51 lines
1.6 KiB
Diff

From f8ec0c6fa2ae2ce7fc3b9ed44c939ad8c5bc346b Mon Sep 17 00:00:00 2001
From: Fijxu <fijxu@nadeko.net>
Date: Tue, 15 Apr 2025 19:48:26 -0400
Subject: [PATCH 15/17] ci: improve container image build times
---
.github/workflows/docker-build-push.yaml | 2 ++
Dockerfile | 10 ++++++----
2 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/.github/workflows/docker-build-push.yaml b/.github/workflows/docker-build-push.yaml
index 8a79d77..69561fa 100644
--- a/.github/workflows/docker-build-push.yaml
+++ b/.github/workflows/docker-build-push.yaml
@@ -70,3 +70,5 @@ jobs:
platforms: linux/amd64,linux/arm64 # Build for multiple architectures
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
+ cache-from: type=gha
+ cache-to: type=gha,mode=max
diff --git a/Dockerfile b/Dockerfile
index 4533e71..bd43ac9 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -11,9 +11,6 @@ RUN mkdir -p /var/tmp/youtubei.js
RUN apt update && apt install -y curl
-COPY ./src/ /app/src/
-COPY deno.json /app/
-
RUN curl -fsSL https://github.com/krallin/tini/releases/download/v${TINI_VERSION}/tini-$(dpkg --print-architecture) \
--output /tini \
&& chmod +x /tini
@@ -23,7 +20,12 @@ RUN arch=$(uname -m) && \
--output /thc \
&& chmod +x /thc
-RUN deno task compile
+COPY deno.json /app/
+COPY deno.lock /app/
+
+COPY ./src/ /app/src/
+
+RUN --mount=type=cache,target=/deno-dir deno task compile
# Stage for creating the non-privileged user
FROM alpine:3.20 AS user-stage
--
2.49.0