Files
penracourses/scripts/local-up.sh
T
2025-12-01 11:12:01 +00:00

23 lines
872 B
Bash
Executable File

#!/bin/sh
set -e
# Simple local bring-up helper. Usage:
# ./rad/scripts/local-up.sh
# It requires rad/.env.dev to exist (do NOT auto-create from examples) and then
# runs the prod+dev compose stack using COMPOSE_ENV to select the env file.
REPO_ROOT="$(cd "$(dirname "$0")/.." && pwd)"
cd "$REPO_ROOT"
if [ ! -f .env.dev ]; then
echo ".env.dev not found. Create .env.dev with your development values (pointing to the external dev DB) and re-run."
echo "You can copy .env.prod.example to start from a template, but DO NOT commit secrets."
exit 1
fi
# Default to 'dev' but allow overriding with COMPOSE_ENV environment variable
COMPOSE_ENV=${COMPOSE_ENV:-dev}
echo "Starting compose with COMPOSE_ENV=$COMPOSE_ENV (using .env.$COMPOSE_ENV)"
COMPOSE_ENV=$COMPOSE_ENV docker compose -f docker/docker-compose.prod.yml -f docker/docker-compose.dev.yml up -d --build