Created
August 6, 2022 12:03
-
-
Save nothub/f0ecbfab8c3f237e7f661d9c7a7d4c78 to your computer and use it in GitHub Desktop.
develop svelte (and other node crap) in containers
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
help: | |
@grep -E '^[a-z.A-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' | |
# test build requirements | |
REQUIRED_BINS := podman | |
$(foreach bin,$(REQUIRED_BINS),\ | |
$(if $(shell command -v $(bin) 2> /dev/null),$(),$(error please install missing build requirement: `$(bin)`))) | |
.ONESHELL: | |
# this will be evaluated to set the shell, even when not called explicitly | |
shell: $(eval SHELL:=/bin/bash) | |
all: help | |
deps: ## install dependencies | |
cd frontend && \ | |
podman run \ | |
--interactive \ | |
--tty \ | |
--rm \ | |
--volume .:/work \ | |
--workdir /work \ | |
docker.io/library/node:16 \ | |
npm install | |
run: deps ## run development server | |
cd frontend && \ | |
podman run \ | |
--interactive \ | |
--tty \ | |
--rm \ | |
--volume .:/work \ | |
--workdir /work \ | |
--env HOST=0.0.0.0 \ | |
--publish 127.0.0.1:5000:5000 \ | |
docker.io/library/node:16 \ | |
npm run dev | |
build: deps ## build production site | |
cd frontend && \ | |
podman run \ | |
--interactive \ | |
--tty \ | |
--rm \ | |
--volume .:/work \ | |
--workdir /work \ | |
docker.io/library/node:16 \ | |
npm run build |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment