From cd16aa3de339da068ecaf410c940d5a44e4f6d84 Mon Sep 17 00:00:00 2001 From: nkalupahana Date: Wed, 2 Oct 2024 18:45:27 -0700 Subject: [PATCH 1/7] Install libvips separately --- backend/Dockerfile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/backend/Dockerfile b/backend/Dockerfile index 3b89e32b..82149f4d 100644 --- a/backend/Dockerfile +++ b/backend/Dockerfile @@ -1,5 +1,9 @@ FROM node:18-slim +RUN DEBIAN_FRONTEND=noninteractive apt-get update && \ + apt-get install -y libvips && \ + apt-get clean + WORKDIR /usr/src/app COPY package*.json ./ RUN npm ci From d58c930d4d677e46ef7eb2ec2aee1792befe2c51 Mon Sep 17 00:00:00 2001 From: nkalupahana Date: Wed, 2 Oct 2024 19:37:47 -0700 Subject: [PATCH 2/7] Build sharp from source --- backend/Dockerfile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/backend/Dockerfile b/backend/Dockerfile index 82149f4d..d96dd20f 100644 --- a/backend/Dockerfile +++ b/backend/Dockerfile @@ -1,13 +1,14 @@ FROM node:18-slim RUN DEBIAN_FRONTEND=noninteractive apt-get update && \ - apt-get install -y libvips && \ + apt-get install -y g++ libvips libvips-dev make pkg-config && \ apt-get clean WORKDIR /usr/src/app COPY package*.json ./ +RUN npm install --build-from-source sharp@0.32.6 RUN npm ci COPY . ./ ENV NODE_ENV=production -CMD [ "npm", "start" ] \ No newline at end of file +CMD [ "npm", "start" ] From 8cbd7c6e93c32bdc4e69c7d3b75334a4c9719782 Mon Sep 17 00:00:00 2001 From: nkalupahana Date: Wed, 2 Oct 2024 19:46:21 -0700 Subject: [PATCH 3/7] umm try after??? --- backend/Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/Dockerfile b/backend/Dockerfile index d96dd20f..c3769473 100644 --- a/backend/Dockerfile +++ b/backend/Dockerfile @@ -6,8 +6,8 @@ RUN DEBIAN_FRONTEND=noninteractive apt-get update && \ WORKDIR /usr/src/app COPY package*.json ./ -RUN npm install --build-from-source sharp@0.32.6 -RUN npm ci +RUN npm ci && \ + npm install --build-from-source sharp@0.32.6 COPY . ./ ENV NODE_ENV=production From b3b8e6f9430cfcac5e3bf57b221acba3b49ec948 Mon Sep 17 00:00:00 2001 From: nkalupahana Date: Wed, 2 Oct 2024 20:08:10 -0700 Subject: [PATCH 4/7] we'll see about this --- backend/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/Dockerfile b/backend/Dockerfile index c3769473..b15a337d 100644 --- a/backend/Dockerfile +++ b/backend/Dockerfile @@ -1,7 +1,7 @@ FROM node:18-slim RUN DEBIAN_FRONTEND=noninteractive apt-get update && \ - apt-get install -y g++ libvips libvips-dev make pkg-config && \ + apt-get install -y g++ libheif1 libvips libvips-dev make pkg-config && \ apt-get clean WORKDIR /usr/src/app From 2db5b807486b2374e25ab9136eea230af923f0ca Mon Sep 17 00:00:00 2001 From: nkalupahana Date: Thu, 3 Oct 2024 19:45:36 -0700 Subject: [PATCH 5/7] oh yeah I think we did it --- backend/Dockerfile | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/backend/Dockerfile b/backend/Dockerfile index b15a337d..b586b00d 100644 --- a/backend/Dockerfile +++ b/backend/Dockerfile @@ -1,13 +1,13 @@ FROM node:18-slim -RUN DEBIAN_FRONTEND=noninteractive apt-get update && \ - apt-get install -y g++ libheif1 libvips libvips-dev make pkg-config && \ - apt-get clean +RUN DEBIAN_FRONTEND=noninteractive sed -i 's/bookworm/trixie/g' /etc/apt/sources.list.d/debian.sources \ + && apt update \ + && apt install -y g++ libvips-dev=8.15.3-1 make python3 \ + && apt clean WORKDIR /usr/src/app COPY package*.json ./ -RUN npm ci && \ - npm install --build-from-source sharp@0.32.6 +RUN npm ci COPY . ./ ENV NODE_ENV=production From b138a27d895de5ae3f65e07fa61a323cf891e1a3 Mon Sep 17 00:00:00 2001 From: nkalupahana Date: Thu, 3 Oct 2024 20:02:51 -0700 Subject: [PATCH 6/7] Switch to apt-get --- backend/Dockerfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/backend/Dockerfile b/backend/Dockerfile index b586b00d..b019b2db 100644 --- a/backend/Dockerfile +++ b/backend/Dockerfile @@ -1,9 +1,9 @@ FROM node:18-slim RUN DEBIAN_FRONTEND=noninteractive sed -i 's/bookworm/trixie/g' /etc/apt/sources.list.d/debian.sources \ - && apt update \ - && apt install -y g++ libvips-dev=8.15.3-1 make python3 \ - && apt clean + && apt-get update \ + && apt-get install -y g++ libvips-dev=8.15.3-1 make python3 \ + && apt-get clean WORKDIR /usr/src/app COPY package*.json ./ From 2d65d8e644b27228b076f68c899dabbcfcd3c833 Mon Sep 17 00:00:00 2001 From: nkalupahana Date: Thu, 3 Oct 2024 20:04:02 -0700 Subject: [PATCH 7/7] rm lists --- backend/Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/backend/Dockerfile b/backend/Dockerfile index b019b2db..c8413788 100644 --- a/backend/Dockerfile +++ b/backend/Dockerfile @@ -3,7 +3,8 @@ FROM node:18-slim RUN DEBIAN_FRONTEND=noninteractive sed -i 's/bookworm/trixie/g' /etc/apt/sources.list.d/debian.sources \ && apt-get update \ && apt-get install -y g++ libvips-dev=8.15.3-1 make python3 \ - && apt-get clean + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* WORKDIR /usr/src/app COPY package*.json ./