update docker
This commit is contained in:
27
build-and-push.sh
Executable file
27
build-and-push.sh
Executable 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"
|
||||
Reference in New Issue
Block a user