summaryrefslogtreecommitdiff
path: root/scripts/server-setup.sh
blob: 154c6c7b280ed2509275c244a9515db868c22780 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/bin/bash
# Run once on a fresh Hetzner VPS (as root). Run this first before other app setups.
set -e

APP_DIR=/app/infra
REPO_DIR=/var/git/hetzner-infra.git

# Install Docker
curl -fsSL https://get.docker.com | sh

# Create shared Docker network
docker network create web || true

mkdir -p "$APP_DIR"
mkdir -p "$REPO_DIR"
git init --bare "$REPO_DIR"

echo ""
echo "Setup complete. On your local machine, run:"
echo "  git remote add hetzner root@<server-ip>:$REPO_DIR"
echo "  git push hetzner master"
echo ""
echo "Then install hooks:"
echo "  ssh root@<server-ip> 'bash /app/infra/scripts/install-hooks.sh'"
echo ""
echo "Then run setup scripts for each app:"
echo "  tokyo-livehouse-events/scripts/server-setup.sh"
echo "  whois-band/scripts/server-setup.sh"