update deployment
This commit is contained in:
parent
cf3f2fa8cc
commit
0117a4889a
@ -1,23 +1,25 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
APP_NAME="eslogad"
|
APP_NAME="eslogad"
|
||||||
PORT="4000"
|
PORT="4000"
|
||||||
|
NETWORK_NAME="pgnet"
|
||||||
|
|
||||||
echo "π Pulling latest code..."
|
echo "π Pulling latest code..."
|
||||||
git pull
|
git pull
|
||||||
|
|
||||||
echo "π³ Building Docker image..."
|
echo "π³ Building Docker image..."
|
||||||
docker build -t $APP_NAME .
|
docker build -t "$APP_NAME:latest" .
|
||||||
|
|
||||||
echo "π Stopping and removing old container..."
|
echo "π Stopping and removing old container..."
|
||||||
docker stop $APP_NAME 2>/dev/null
|
docker stop "$APP_NAME" 2>/dev/null || true
|
||||||
docker rm $APP_NAME 2>/dev/null
|
docker rm "$APP_NAME" 2>/dev/null || true
|
||||||
|
|
||||||
|
echo "π Ensuring Docker network exists..."
|
||||||
|
docker network inspect "$NETWORK_NAME" >/dev/null 2>&1 || docker network create "$NETWORK_NAME"
|
||||||
|
|
||||||
echo "π Running new container..."
|
echo "π Running new container..."
|
||||||
docker run -d --name $APP_NAME \
|
docker run -d \
|
||||||
-p $PORT:$PORT \
|
--name "$APP_NAME" \
|
||||||
|
--network "$NETWORK_NAME" \
|
||||||
|
-p "$PORT:$PORT" \
|
||||||
-v "$(pwd)/infra":/infra:ro \
|
-v "$(pwd)/infra":/infra:ro \
|
||||||
-v "$(pwd)/templates":/templates:ro \
|
-v "$(pwd)/templates":/templates:ro \
|
||||||
$APP_NAME:latest
|
"$APP_NAME:latest"
|
||||||
|
|
||||||
echo "β
Deployment complete."
|
|
||||||
Loadingβ¦
x
Reference in New Issue
Block a user