Skip to content

Commit

Permalink
✨ Pnpm installer script
Browse files Browse the repository at this point in the history
  • Loading branch information
Rachid F committed Jul 7, 2024
1 parent 984b4cf commit d9f225a
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions packages/api/Dockerfile.pnpm-installer
Original file line number Diff line number Diff line change
@@ -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 [email protected]

# Start Script

# Set environment variable
ENV PACKAGE="$PACKAGE"

WORKDIR /app/packages/api

CMD pnpm add "${PACKAGE_NAME}"

0 comments on commit d9f225a

Please sign in to comment.