Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),

- **Docker**: Root Compose refuses to start when `SITMUN_USER_SECRET`, `MIDDLEWARE_SECRET`, or `SITMUN_MBTILES_JOB_HANDLE_SECRET` is unset. `setup.sh` and `setup.ps1` generate the three values into a new `.env` when those keys are absent. Profile files do not store them ([#113](https://github.com/sitmun/sitmun-application-stack/issues/113)).

### Removed

#### Stack-level

- **Docker**: `profiles/postgres/docker-compose.yml` and `profiles/oracle/docker-compose.yml` are removed. PostgreSQL and Oracle start from the root Compose file after copying `profiles/postgres.env` or `profiles/oracle.env` to `.env` ([#110](https://github.com/sitmun/sitmun-application-stack/issues/110)).

## [1.2.9] - 2026-09-19

### Changed
Expand Down
34 changes: 13 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -603,34 +603,26 @@ profiles/
development/
backend/ # Backend Spring config (application.yml, Liquibase migrations)
proxy/ # Proxy Spring config
oracle/
docker-compose.yml # Backend + Oracle DB with schema + seed data
postgres/
docker-compose.yml # Backend + Postgres DB with schema + seed data
oracle/ # Oracle Liquibase and backend config, mounted by the root Compose file
postgres/ # PostgreSQL Liquibase and backend config, mounted by the root Compose file
```

**Running a standalone profile:**
PostgreSQL and Oracle start from the repository root. Copy the profile, append the three secrets when they are absent, then start the root Compose file. `SITMUN_CONFIG_DIR` mounts `profiles/postgres` or `profiles/oracle`.

```bash
# Start Postgres profile (backend + database with dev seed data)
cd profiles/postgres
docker compose up -d --build

# Verify backend health
curl http://localhost:8080/api/dashboard/health
cp profiles/postgres.env .env
echo "SITMUN_USER_SECRET=$(openssl rand -hex 32)" >> .env
echo "MIDDLEWARE_SECRET=$(openssl rand -hex 32)" >> .env
echo "SITMUN_MBTILES_JOB_HANDLE_SECRET=$(openssl rand -hex 32)" >> .env
docker compose up -d

# Start Oracle profile (mutually exclusive - use different terminal or stop postgres first)
cd ../oracle
docker compose up -d --build
cp profiles/oracle.env .env
echo "SITMUN_USER_SECRET=$(openssl rand -hex 32)" >> .env
echo "MIDDLEWARE_SECRET=$(openssl rand -hex 32)" >> .env
echo "SITMUN_MBTILES_JOB_HANDLE_SECRET=$(openssl rand -hex 32)" >> .env
docker compose up -d
```

**Important notes:**

- Profiles use `SPRING_LIQUIBASE_CONTEXTS=dev` to bootstrap schema + development seed data via Liquibase on startup.
- Backend listens on port `8080`, databases on standard ports (`5432` for Postgres, `1521` for Oracle).
- Profiles share the same container names and ports - run only one profile at a time locally.
- For production or custom contexts, override `SPRING_LIQUIBASE_CONTEXTS` in the compose environment section.

### Development Workflow

1. **Update Repository and Submodules**
Expand Down
131 changes: 0 additions & 131 deletions profiles/oracle/docker-compose.yml

This file was deleted.

122 changes: 0 additions & 122 deletions profiles/postgres/docker-compose.yml

This file was deleted.

26 changes: 26 additions & 0 deletions tools/scripts/check-compose-secrets.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/env bash
# Root Compose must refuse to render when the three secrets are unset.
# PostgreSQL and Oracle must start from that root file only.
#
# Uses profiles/postgres.env, which does not assign the secrets. Shell values
# for those names are cleared so a developer .env cannot hide a default.
Expand Down Expand Up @@ -37,3 +38,28 @@ if ! grep -q 'is required' <<<"$output"; then
fi

echo "root compose refuses to render without the three secrets"

standalone_fail=0
for path in profiles/postgres/docker-compose.yml profiles/oracle/docker-compose.yml; do
if [[ -f "$path" ]]; then
echo "standalone compose file still present: $path" >&2
standalone_fail=1
fi
done

if grep -q 'cd profiles/postgres' README.md; then
echo "README still tells operators to cd profiles/postgres" >&2
standalone_fail=1
fi

if grep -q 'profiles/postgres/docker-compose.yml' tools/scripts/verify-compose-profiles.sh \
|| grep -q 'profiles/oracle/docker-compose.yml' tools/scripts/verify-compose-profiles.sh; then
echo "verify-compose-profiles.sh still targets a standalone compose file" >&2
standalone_fail=1
fi

if [[ "$standalone_fail" -ne 0 ]]; then
exit 1
fi

echo "root compose is the only postgres and oracle entry point"
26 changes: 0 additions & 26 deletions tools/scripts/verify-compose-profiles.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,11 @@ REPO_ROOT="$(cd "$(dirname "$0")/../.." && pwd)"
cd "$REPO_ROOT"

SKIP_ORACLE=false
SKIP_STANDALONE=false
SKIP_BUILD=false
ONLY_BUILD=false
for arg in "$@"; do
case "$arg" in
--skip-oracle) SKIP_ORACLE=true ;;
--skip-standalone) SKIP_STANDALONE=true ;;
--skip-build) SKIP_BUILD=true ;;
--only-build) ONLY_BUILD=true ;;
esac
Expand Down Expand Up @@ -374,30 +372,6 @@ if [[ "$SKIP_ORACLE" == "false" ]]; then
run_target "prod/oracle+demo+mbtiles" "$TMPDIR_ENV/prod-oracle-demo-mbtiles.env"
fi

# ---------------------------------------------------------------------------
# Standalone profiles (their own docker-compose.yml, no root .env)
# Standalone profiles bind standard ports (8080, 8081, 5432/1521).
# Skip with --skip-standalone if those ports are already in use on the host.
# ---------------------------------------------------------------------------

if [[ "$SKIP_STANDALONE" == "false" ]]; then
echo ""
echo "=== Standalone profiles ==="

make_env_file /dev/null "" "$TMPDIR_ENV/standalone-postgres.env"
run_target "standalone/profiles/postgres" "$TMPDIR_ENV/standalone-postgres.env" \
"profiles/postgres/docker-compose.yml"

if [[ "$SKIP_ORACLE" == "false" ]]; then
make_env_file /dev/null "" "$TMPDIR_ENV/standalone-oracle.env"
run_target "standalone/profiles/oracle" "$TMPDIR_ENV/standalone-oracle.env" \
"profiles/oracle/docker-compose.yml"
fi
else
echo ""
echo "=== Standalone profiles: skipped (--skip-standalone) ==="
fi

# ---------------------------------------------------------------------------
# Summary
# ---------------------------------------------------------------------------
Expand Down
Loading