From d9f225a384dea8ba26aeaee2d4f2ec0320242b8f Mon Sep 17 00:00:00 2001 From: Rachid F Date: Sun, 7 Jul 2024 13:37:57 -0700 Subject: [PATCH] :sparkles: Pnpm installer script --- packages/api/Dockerfile.pnpm-installer | 29 ++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 packages/api/Dockerfile.pnpm-installer diff --git a/packages/api/Dockerfile.pnpm-installer b/packages/api/Dockerfile.pnpm-installer new file mode 100644 index 000000000..3f7ede759 --- /dev/null +++ b/packages/api/Dockerfile.pnpm-installer @@ -0,0 +1,29 @@ +################################################ +# 1/ move to the repo root directory +# 2/ build the image : docker build -t package_installer -f ./packages/api/Dockerfile.pnpm-installer . +# 3/ run with: docker run -v $(pwd):/app/ -e PACKAGE_NAME=PACKAGE_NAME package_installer +# example: docker run -v $(pwd):/app/ -e PACKAGE_NAME=@stripe/stripe-js package_installer +################################################ + +FROM node:20-alpine AS base +# ======================================================================= +FROM base AS builder +RUN apk add --no-cache libc6-compat netcat-openbsd curl +RUN apk update + +# Set pnpm +ENV PNPM_HOME="/pnpm" +ENV PATH="$PNPM_HOME:$PATH" +RUN corepack enable + +WORKDIR /app +RUN pnpm add -g turbo@1.13.4 + +# Start Script + +# Set environment variable +ENV PACKAGE="$PACKAGE" + +WORKDIR /app/packages/api + +CMD pnpm add "${PACKAGE_NAME}" \ No newline at end of file