diff --git a/deployment.sh b/deployment.sh index 5812063..5eebf56 100644 --- a/deployment.sh +++ b/deployment.sh @@ -1,21 +1,22 @@ #!/bin/bash +set -euo pipefail APP_NAME="apskel-pos" -PORT="4000" +PORT="3300" # match the app’s listen port (and EXPOSE/healthcheck) echo "🔄 Pulling latest code..." git pull -echo "🐳 Building Docker image..." -docker build -t $APP_NAME . +echo "🐳 Building Docker image (production target)..." +docker build --target production -t $APP_NAME:latest . echo "🛑 Stopping and removing old container..." -docker stop $APP_NAME 2>/dev/null -docker rm $APP_NAME 2>/dev/null +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