Files

44 lines
924 B
Bash
Raw Permalink Normal View History

2026-04-19 13:33:43 +02:00
#!/usr/bin/env sh
set -eu
PROJECT_ROOT=$(CDPATH= cd -- "$(dirname -- "$0")/.." && pwd)
cd "$PROJECT_ROOT"
if [ ! -f ".env" ] && [ -f ".env.example" ]; then
echo ".env not found. Create it first from .env.example:"
2026-04-19 13:33:43 +02:00
echo " cp .env.example .env"
exit 1
fi
set -a
. ./.env
set +a
DATA_DIR=${DATA_DIR:-./data}
APP_PORT=${APP_PORT:-10000}
2026-04-19 13:33:43 +02:00
mkdir -p "$DATA_DIR"
echo "[1/4] Pull latest code if this directory is a git repository"
2026-04-19 13:33:43 +02:00
if [ -d ".git" ]; then
git pull --ff-only
else
echo "Skipped: current directory is not a git repository"
2026-04-19 13:33:43 +02:00
fi
echo "[2/4] Pull and update containers"
docker compose pull web
docker compose up -d
2026-04-19 13:33:43 +02:00
echo "[3/4] Current container status"
2026-04-19 13:33:43 +02:00
docker compose ps
echo "[4/4] Recent logs"
2026-04-19 13:33:43 +02:00
docker compose logs --tail=50 web
echo
echo "Deployment complete. Default application URLs:"
echo " https://${HOST_DOMAIN:-localhost}"
echo " Backend port mapping: localhost:$APP_PORT -> container:10000"
2026-04-19 13:33:43 +02:00