From 5acc1d9af75408b64658610740d73f7b942b8a1c Mon Sep 17 00:00:00 2001 From: Ingwie Phoenix Date: Fri, 18 Aug 2023 14:51:30 +0200 Subject: [PATCH] Optimize Dockerfile, add arm64! Removing "--platform=" and slightly re-structuring the "apt-get" calls allows for this image to be successfuly built for arm64 as well - at least on an arm64 host. --- Dockerfile | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index 89b9609..d1bd8a8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,14 +1,16 @@ -FROM --platform=linux/amd64 node:19-buster-slim as build +FROM node:19-buster-slim as build WORKDIR /app -COPY package.json package-lock.json . +RUN apt-get update -y && apt-get install -y openssl python3 build-essential make gcc + +COPY package.json package-lock.json ./ RUN npm i +RUN apt-get purge -y gcc make build-essential && apt-get autoremove -y + COPY src/ src/ COPY prisma/schema.prisma prisma/ -COPY tsconfig.json . - -RUN apt-get update -y && apt-get install -y openssl +COPY tsconfig.json ./ RUN npx prisma generate