Files
AdventureLog/aio/env-setup.sh
Sean Morley 7f6bf1390a Add Docker and environment configuration files for AdventureLog
- Introduced .dockerignore to exclude unnecessary files from Docker context.
- Added .env.aio.example for minimal configuration of the AdventureLog All-in-One setup.
- Updated .env.example to include optional SITE_URL and GUNICORN_WORKERS settings.
- Enhanced deploy.sh script for improved deployment flexibility and backup options.
- Updated docker-compose files to use PostGIS 16-3.5 and added health checks for services.
- Created docker-compose.aio.yml for All-in-One deployment configuration.
- Improved health checks and service dependencies in docker-compose.dev.yml and docker-compose.yml.
- Added GitHub workflows for building and pushing Docker images, including smoke tests for AIO setup.
2026-06-06 18:54:25 -04:00

42 lines
1.4 KiB
Bash

#!/bin/bash
# Derive full AdventureLog configuration from minimal AIO environment variables.
set -euo pipefail
SITE_URL="${SITE_URL:-http://localhost:8015}"
SITE_URL="${SITE_URL%/}"
export SITE_URL
export ORIGIN="${ORIGIN:-$SITE_URL}"
export FRONTEND_URL="${FRONTEND_URL:-$SITE_URL}"
export PUBLIC_URL="${PUBLIC_URL:-$SITE_URL}"
export CSRF_TRUSTED_ORIGINS="${CSRF_TRUSTED_ORIGINS:-$SITE_URL}"
export PUBLIC_SERVER_URL="${PUBLIC_SERVER_URL:-http://127.0.0.1:8000}"
export BODY_SIZE_LIMIT="${BODY_SIZE_LIMIT:-Infinity}"
export DEBUG="${DEBUG:-False}"
export PORT=3000
export PGHOST="${PGHOST:-db}"
export POSTGRES_DB="${POSTGRES_DB:-database}"
export POSTGRES_USER="${POSTGRES_USER:-adventure}"
export PGDATABASE="${PGDATABASE:-$POSTGRES_DB}"
export PGUSER="${PGUSER:-$POSTGRES_USER}"
if [[ -z "${POSTGRES_PASSWORD:-}" ]]; then
echo "ERROR: POSTGRES_PASSWORD is required for the AIO container." >&2
exit 1
fi
export PGPASSWORD="${POSTGRES_PASSWORD}"
if [[ -z "${SECRET_KEY:-}" ]]; then
export SECRET_KEY="$(python3 -c 'import secrets; print(secrets.token_urlsafe(50))')"
fi
export DJANGO_ADMIN_USERNAME="${DJANGO_ADMIN_USERNAME:-admin}"
export DJANGO_ADMIN_PASSWORD="${DJANGO_ADMIN_PASSWORD:-admin}"
export DJANGO_ADMIN_EMAIL="${DJANGO_ADMIN_EMAIL:-admin@example.com}"
echo "AIO configuration:"
echo " SITE_URL=$SITE_URL"
echo " PUBLIC_SERVER_URL=$PUBLIC_SERVER_URL"
echo " PGHOST=$PGHOST"