apskel-pos-backend/deployment.sh
Aditya Siregar c107733add Update
2025-09-01 16:20:27 +07:00

25 lines
555 B
Bash

#!/bin/bash
set -euo pipefail
APP_NAME="apskel-pos"
PORT="3300"
echo "🔄 Pulling latest code..."
git pull
echo "🐳 Building Docker image (production target)..."
docker build --target production -t $APP_NAME:latest .
echo "🛑 Stopping and removing old container..."
docker rm -f $APP_NAME 2>/dev/null || true
echo "🚀 Running new container..."
docker run -d --name $APP_NAME \
-p $PORT:$PORT \
-e TZ=Asia/Jakarta \
-v "$(pwd)/infra":/infra:ro \
-v "$(pwd)/templates":/templates:ro \
$APP_NAME:latest
echo "✅ Deployment complete."