Compare commits

...

2 Commits

Author SHA1 Message Date
William Valentin
cdc6b1d7e3 feat: add comprehensive Makefile for building app and Docker images
- Add targets for building TypeScript app with bun
- Add multi-architecture Docker build support (amd64, arm64)
- Support development (dev) and production (start) modes
- Add local Docker build target for faster testing
- Configure docker image registry integration
- Include help target for viewing available commands
- Support automated lock file updates
2025-10-17 10:11:58 -07:00
William Valentin
79e973f390 chore: upgrade bun runtime version to 1.2.20
- Updates Dockerfile ARG BUN_VERSION from 1.0.0 to 1.2.20
- Resolves lockfile compatibility issues with newer bun versions
- Ensures consistency between local and Docker environments
2025-10-17 10:11:49 -07:00
2 changed files with 62 additions and 1 deletions

View File

@@ -1,6 +1,6 @@
# syntax=docker/dockerfile:1
ARG BUN_VERSION=1.0.0
ARG BUN_VERSION=1.2.20
FROM oven/bun:${BUN_VERSION} AS base
WORKDIR /app

61
s3-nodejs-api/Makefile Normal file
View File

@@ -0,0 +1,61 @@
.PHONY: build build-docker build-docker-prod clean help install start dev test lock-update
# Variables
IMAGE_NAME ?= media-streamer
IMAGE_TAG ?= latest
BUN_VERSION ?= 1.2.20
IMAGE_REGISTRY ?= gitea-gitea-ssh.taildb3494.ts.net/will
help: ## Show this help message
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}'
lock-update: ## Update bun.lock file
bun install
install: lock-update ## Install dependencies
build: ## Build the TypeScript app
bun run build
dev: ## Start the app in development mode with watch
bun run start:dev
start: build ## Build and start the app in production mode
bun run start
test: ## Run tests
bun test
clean: ## Clean build artifacts
rm -rf dist/
build-docker: ## Build Docker image for multiple architectures (amd64, arm64)
docker buildx build \
--platform linux/amd64 \
--build-arg BUN_VERSION=$(BUN_VERSION) \
-t $(IMAGE_REGISTRY)/$(IMAGE_NAME):$(IMAGE_TAG) \
.
build-docker-prod: ## Build Docker image for multiple architectures with production optimizations
docker buildx build \
--platform linux/amd64,linux/arm64 \
--build-arg BUN_VERSION=$(BUN_VERSION) \
-t $(IMAGE_REGISTRY)/$(IMAGE_NAME):$(IMAGE_TAG) \
--push \
.
build-docker-local: ## Build Docker image for current architecture only (faster for local testing)
docker build \
--build-arg BUN_VERSION=$(BUN_VERSION) \
-t $(IMAGE_REGISTRY)/$(IMAGE_NAME):$(IMAGE_TAG) \
.
push-docker: ## Push Docker image to registry (requires IMAGE_REGISTRY set)
@if [ -z "$(IMAGE_REGISTRY)" ]; then \
echo "Error: IMAGE_REGISTRY not set"; \
exit 1; \
fi
docker tag $(IMAGE_NAME):$(IMAGE_TAG) $(IMAGE_REGISTRY)/$(IMAGE_NAME):$(IMAGE_TAG)
docker push $(IMAGE_REGISTRY)/$(IMAGE_NAME):$(IMAGE_TAG)
all: clean install build build-docker ## Clean, install, build app, and build Docker image