chore: add Dockerfile, docker-compose, and .dockerignore for multi-service setup

Introduce a Dockerfile for building the Palmr application with multi-stage builds for both server and web components. Update docker-compose.yaml to consolidate services under a single 'palmr' service, ensuring proper health checks and environment variable configurations. Add a .dockerignore file to optimize Docker builds by excluding unnecessary files. Include a Makefile for simplified build and deployment commands.
This commit is contained in:
Daniel Luiz Alves
2025-05-27 00:50:46 -03:00
parent a9191d6b54
commit d40ef51695
16 changed files with 466 additions and 127 deletions

47
Makefile Normal file
View File

@@ -0,0 +1,47 @@
.PHONY: help build start clean logs stop restart
# Default target
help:
@echo "🚀 Palmr - Available Commands:"
@echo ""
@echo " make build - Build Docker image with multi-platform support"
@echo " make start - Start the application using docker-compose"
@echo " make stop - Stop all running containers"
@echo " make logs - Show application logs"
@echo " make clean - Clean up containers and images"
@echo " make shell - Access the application container shell"
@echo ""
@echo "📁 Scripts location: ./infra/"
# Build Docker image using the build script
build:
@echo "🏗️ Building Palmr Docker image..."
@chmod +x ./infra/build-docker.sh
@./infra/build-docker.sh
# Start the application
start:
@echo "🚀 Starting Palmr application..."
@docker-compose up -d
# Stop the application
stop:
@echo "🛑 Stopping Palmr application..."
@docker-compose down
# Show logs
logs:
@echo "📋 Showing Palmr logs..."
@docker-compose logs -f
# Clean up containers and images
clean:
@echo "🧹 Cleaning up Docker containers and images..."
@docker-compose down -v
@docker system prune -f
@echo "✅ Cleanup completed!"
# Access container shell
shell:
@echo "🐚 Accessing Palmr container shell..."
@docker-compose exec palmr /bin/sh