feat: enhance Docker build process and deployment options

- Add multi-platform Docker build support with docker-bake.hcl
- Update Dockerfile with improved production build configurations
- Enhance Makefile with streamlined deployment targets for local, dev, and prod
- Improve buildx-helper.sh script for better cross-platform builds
- Fix production build security validations for JWT_SECRET and SESSION_SECRET
- Add comprehensive deployment documentation and environment setup guides

These changes enable efficient multi-platform image creation and provide
clear deployment workflows for different environments.
This commit is contained in:
William Valentin
2025-09-08 19:48:26 -07:00
parent 430ed7458b
commit 6f1cf76a86
4 changed files with 661 additions and 180 deletions

View File

@@ -110,6 +110,42 @@ docker-build: ## Build Docker images (local and multi-platform)
@bun run docker:build-local
@bun run docker:build 2>/dev/null || true
docker-build-local: ## Build Docker image for local platform only
@printf "$(BLUE)Building local Docker image...$(RESET)\n"
@./scripts/buildx-helper.sh build-local
docker-build-multi: ## Build multi-platform Docker images
@printf "$(BLUE)Building multi-platform Docker images...$(RESET)\n"
@./scripts/buildx-helper.sh build-multi
docker-build-multi-dev: ## Build multi-platform Docker images for development
@printf "$(BLUE)Building multi-platform Docker images for development...$(RESET)\n"
@./scripts/buildx-helper.sh build-multi-dev
docker-build-push: ## Build and push multi-platform Docker images
@printf "$(BLUE)Building and pushing multi-platform Docker images...$(RESET)\n"
@./scripts/buildx-helper.sh build-push
docker-push: ## Push existing Docker images to registry
@printf "$(BLUE)Pushing Docker images to registry...$(RESET)\n"
@./scripts/buildx-helper.sh push
docker-setup: ## Setup Docker buildx builder instance
@printf "$(BLUE)Setting up Docker buildx builder...$(RESET)\n"
@./scripts/buildx-helper.sh setup
docker-inspect: ## Inspect Docker buildx builder
@printf "$(BLUE)Inspecting Docker buildx builder...$(RESET)\n"
@./scripts/buildx-helper.sh inspect
docker-bake: ## Build using docker-bake.hcl
@printf "$(BLUE)Building using docker-bake.hcl...$(RESET)\n"
@./scripts/buildx-helper.sh bake
docker-list: ## List available Docker buildx builders
@printf "$(BLUE)Listing Docker buildx builders...$(RESET)\n"
@./scripts/buildx-helper.sh list
docker-down: ## Stop and remove Docker containers
@printf "$(BLUE)Stopping Docker containers...$(RESET)\n"
@if docker-compose -f docker/docker-compose.yaml ps --services 2>/dev/null | grep -q .; then \
@@ -125,6 +161,10 @@ docker-clean: docker-down ## Stop containers and clean up volumes/images
@docker image prune -f --filter "until=24h" 2>/dev/null || true
@docker volume prune -f 2>/dev/null || true
docker-cleanup: ## Remove buildx builder and cleanup
@printf "$(BLUE)Cleaning up Docker buildx resources...$(RESET)\n"
@./scripts/buildx-helper.sh cleanup
##@ Kubernetes Deployment
deploy-dev: ## Deploy to development environment