#!/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:" echo " cp .env.example .env" exit 1 fi set -a . ./.env set +a DATA_DIR=${DATA_DIR:-./data} APP_PORT=${APP_PORT:-10000} mkdir -p "$DATA_DIR" echo "[1/4] Pull latest code if this directory is a git repository" if [ -d ".git" ]; then git pull --ff-only else echo "Skipped: current directory is not a git repository" fi echo "[2/4] Pull and update containers" docker compose pull web docker compose up -d echo "[3/4] Current container status" docker compose ps echo "[4/4] Recent logs" 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"