update docker

This commit is contained in:
Phuoc Nguyen
2025-10-10 17:13:45 +07:00
parent 87c12b9927
commit 8c34460889
5 changed files with 478 additions and 50 deletions

27
build-and-push.sh Executable file
View File

@@ -0,0 +1,27 @@
#!/bin/bash
# Build and Push Docker Image Script
# This script builds the Docker image and pushes it to a registry
set -e # Exit on error
# Configuration
IMAGE_NAME="retail-backend"
REGISTRY="renolation" # Change this to your Docker Hub username or registry URL
VERSION="latest"
FULL_IMAGE="${REGISTRY}/${IMAGE_NAME}:${VERSION}"
echo "🏗️ Building Docker image..."
docker build -t ${IMAGE_NAME}:${VERSION} .
echo "🏷️ Tagging image for registry..."
docker tag ${IMAGE_NAME}:${VERSION} ${FULL_IMAGE}
echo "📤 Pushing image to registry..."
docker push ${FULL_IMAGE}
echo "✅ Successfully built and pushed: ${FULL_IMAGE}"
echo ""
echo "To use this image on another server, run:"
echo " docker pull ${FULL_IMAGE}"
echo " docker-compose -f docker-compose.prod.yml up -d"