- next.config.js: basePath from NEXT_PUBLIC_BASE_PATH env var (build arg) - docker-compose.yml: builds with /homepage base path, exposes :3001 locally, mounts config dir and Docker socket - deploy.sh: clone/pull + build + start script for optical-dev server Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
30 lines
596 B
Bash
30 lines
596 B
Bash
#!/bin/bash
|
|
set -e
|
|
|
|
DEPLOY_DIR="/opt/homepage"
|
|
REPO="git@bitbucket.org:zlalani/homepage.git"
|
|
|
|
echo "=== Homepage Deploy ==="
|
|
|
|
if [ ! -d "$DEPLOY_DIR/.git" ]; then
|
|
echo "Cloning repository..."
|
|
git clone "$REPO" "$DEPLOY_DIR"
|
|
cd "$DEPLOY_DIR"
|
|
else
|
|
echo "Pulling latest changes..."
|
|
cd "$DEPLOY_DIR"
|
|
git pull origin dev
|
|
fi
|
|
|
|
mkdir -p config
|
|
|
|
echo "Building and starting container..."
|
|
docker compose build --no-cache
|
|
docker compose up -d
|
|
|
|
echo "Waiting for healthcheck..."
|
|
sleep 15
|
|
docker compose ps
|
|
|
|
echo ""
|
|
echo "Done. Homepage available at https://optical-dev.oliver.solutions/homepage"
|