-
Notifications
You must be signed in to change notification settings - Fork 195
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Rachid F
committed
Jul 7, 2024
1 parent
984b4cf
commit d9f225a
Showing
1 changed file
with
29 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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}" |