Files
Palmr/infra/build-docker.sh
Daniel Luiz Alves d40ef51695 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.
2025-05-27 00:50:46 -03:00

43 lines
1.2 KiB
Bash
Executable File

#!/bin/bash
# Ask for tag interactively
echo "🏷️ Please enter a tag for the build (e.g., v1.0.0, production, beta):"
read -p "Tag: " TAG
# Check if tag was provided
if [ -z "$TAG" ]; then
echo "❌ Error: Tag cannot be empty"
echo "Please run the script again and provide a valid tag"
exit 1
fi
echo "🚀 Building Palmr Unified Image for AMD64 and ARM..."
echo "📦 Building tags: latest and $TAG"
# Ensure buildx is available and create/use a builder instance
docker buildx create --name palmr-builder --use 2>/dev/null || docker buildx use palmr-builder
# Build the unified image for multiple platforms without cache
docker buildx build \
--platform linux/amd64,linux/arm64 \
--no-cache \
-t kyantech/palmr:latest \
-t kyantech/palmr:$TAG \
--load \
.
if [ $? -eq 0 ]; then
echo "✅ Multi-platform build completed successfully!"
echo ""
echo "Built for platforms: linux/amd64, linux/arm64"
echo "Built tags: palmr:latest and palmr:$TAG"
echo ""
echo "Access points:"
echo "- API: http://localhost:3333"
echo "- Web App: http://localhost:5487"
echo ""
echo "Read the docs for more information"
else
echo "❌ Build failed!"
exit 1
fi