meti-backend/deployment.sh

24 lines
492 B
Bash
Raw Normal View History

2025-08-09 15:08:26 +07:00
#!/bin/bash
2025-08-15 21:17:19 +07:00
APP_NAME="meti-backend"
PORT="4001"
2025-08-09 15:08:26 +07:00
echo "🔄 Pulling latest code..."
git pull
echo "🐳 Building Docker image..."
docker build -t $APP_NAME .
echo "🛑 Stopping and removing old container..."
docker stop $APP_NAME 2>/dev/null
docker rm $APP_NAME 2>/dev/null
echo "🚀 Running new container..."
docker run -d --name $APP_NAME \
-p $PORT:$PORT \
-v "$(pwd)/infra":/infra:ro \
-v "$(pwd)/templates":/templates:ro \
$APP_NAME:latest
echo "✅ Deployment complete."