Skip to content

node20 pnpm

Dockefile

Dockefile
FROM node:20.10.0

RUN npm config set registry https://registry.npmmirror.com/
RUN npm install npm@latest -g
RUN npm install pnpm -g

Makefile

Makefile
WORK_DIR  := /root/project
CACHE_DIR := /root/.cache
OUT_WORK_DIR := $(PWD)
OUT_CACHE_DIR := $(PWD)/__env_cache__
IMAGE_TAG := node20

BIN_DOCKER := podman

DOCKER_RUN := $(BIN_DOCKER) run \
--rm -it \
-v $(OUT_WORK_DIR):$(WORK_DIR) \
-v $(OUT_CACHE_DIR):$(CACHE_DIR) \
-w $(WORK_DIR) \
--network host \
$(IMAGE_TAG)

build:
	$(BIN_DOCKER) build . -t $(IMAGE_TAG)
install:
	mkdir $(OUT_CACHE_DIR)
	$(DOCKER_RUN) pnpm install
run:
	$(DOCKER_RUN) pnpm run $(name)

Released under the MIT License.