add deployment

This commit is contained in:
Aditya Siregar 2025-08-08 22:48:57 +07:00
parent 721235e6fe
commit dc23a318cd

23
deployment.sh Normal file
View File

@ -0,0 +1,23 @@
#!/bin/bash
APP_NAME="apskel-pos"
PORT="4000"
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."