docker-compose.yml (postgres 16 + odoo:19.0), odoo.conf, env template, and setup/backup/update/demo-data scripts. update.sh always backs up and records the previous image before upgrading modules, per the lesson paid for on the Frappe track. .gitattributes pins LF on shell scripts so they don't break under the container's bash on checkout from Windows. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
35 lines
952 B
Bash
35 lines
952 B
Bash
#!/bin/bash
|
|
# One-command bring-up for the School ERP Odoo 19 Community stack.
|
|
# Usage: ./scripts/setup.sh
|
|
set -e
|
|
|
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
|
cd "$SCRIPT_DIR"
|
|
|
|
if [ ! -f .env ]; then
|
|
echo "[!] .env not found — copying from .env.example"
|
|
cp .env.example .env
|
|
fi
|
|
|
|
echo "[->] Starting db + odoo..."
|
|
docker compose up -d db
|
|
docker compose up -d odoo
|
|
|
|
echo "[->] Waiting for Odoo to accept connections..."
|
|
set -a; source .env; set +a
|
|
PORT="${HTTP_PORT:-8069}"
|
|
MAX_WAIT=90
|
|
WAITED=0
|
|
until curl -sf "http://localhost:${PORT}/web/login" >/dev/null 2>&1; do
|
|
sleep 3
|
|
WAITED=$((WAITED + 3))
|
|
if [ "$WAITED" -ge "$MAX_WAIT" ]; then
|
|
echo "[x] Odoo did not come up within ${MAX_WAIT}s. Check: docker compose logs odoo"
|
|
exit 1
|
|
fi
|
|
echo -n "."
|
|
done
|
|
echo ""
|
|
echo "[OK] Odoo is up at http://localhost:${PORT}"
|
|
echo "[->] Next: ./scripts/demo-data.sh to load the demo school, or create a database via the browser."
|