feat: add Docker build

This commit is contained in:
2025-10-27 15:19:40 +01:00
parent be6d9bb98a
commit 06fc5e6747
3 changed files with 89 additions and 0 deletions

40
Makefile Normal file
View File

@@ -0,0 +1,40 @@
.PHONY: install build run clean docker-build docker-run docker-push
# Install dependencies
install:
npm install
# Build the application (if needed)
build: install
# Run the application
run:
node server/index.js
# Start in development mode
dev:
node server/index.js
# Clean build artifacts
clean:
rm -rf node_modules
rm -f package-lock.json
# Docker variables
DOCKER_REGISTRY ?=
IMAGE_NAME = wirelos/spore-ledlab
IMAGE_TAG ?= latest
FULL_IMAGE_NAME = $(if $(DOCKER_REGISTRY),$(DOCKER_REGISTRY)/$(IMAGE_NAME),$(IMAGE_NAME)):$(IMAGE_TAG)
# Build Docker image
docker-build:
docker build -t $(FULL_IMAGE_NAME) .
# Run Docker container
docker-run:
docker run -p 8080:8080 --rm $(FULL_IMAGE_NAME)
# Push Docker image
docker-push:
docker push $(FULL_IMAGE_NAME)