The script bailed when 8003 was taken on the dev server. Per spec, it
should never block on a port clash — find a free port and run with it.
How it picks ports:
- Reads OSOP_DB_PORT / OSOP_REDIS_PORT / OSOP_BACKEND_PORT from .env,
falling back to defaults 5435 / 6380 / 8003.
- For each, if the preferred port is taken on the host, scans upward in
a sane range (5435-5499 / 6380-6399 / 8003-8099) for the next free one.
- Persists chosen ports back to .env via an idempotent KEY=VALUE upsert,
so subsequent deploys keep using the same allocation.
- If our compose project is already running, skips the scan and reuses
the current ports (re-deploy in place).
Compose port mappings now reference those env vars with defaults:
127.0.0.1:${OSOP_DB_PORT:-5435}:5432, etc.
Apache config templating:
- deploy/apache-osop.conf.tmpl has __BACKEND_PORT__ placeholder.
- The script renders it to deploy/apache-osop.conf each run with the
chosen backend port substituted in. The rendered file is gitignored
(the template is the source of truth in git).
- If the backend port changed (or the Apache vhost doesn't yet Include
our conf), the script tells the user to reload Apache.
This means a fresh server hits the conflict on 8003 (something else is
listening), the script picks 8004 silently, writes it to .env, renders
apache-osop.conf with 8004, brings the stack up, and tells you to
reload Apache. Re-running the script on the same server keeps 8004.
55 lines
667 B
Text
55 lines
667 B
Text
# Node artifact files
|
|
node_modules/
|
|
dist/
|
|
|
|
# Generated by deploy/deploy.sh from apache-osop.conf.tmpl with the
|
|
# server's actual backend port substituted in. The template is the
|
|
# source of truth.
|
|
deploy/apache-osop.conf
|
|
|
|
# Compiled Python bytecode
|
|
*.py[cod]
|
|
__pycache__/
|
|
*.egg-info/
|
|
.pytest_cache/
|
|
.mypy_cache/
|
|
|
|
# Virtual environments
|
|
venv/
|
|
.venv/
|
|
env/
|
|
|
|
# Environment / secrets
|
|
.env
|
|
.env.local
|
|
.env.*.local
|
|
|
|
# Log files
|
|
*.log
|
|
|
|
# IDE
|
|
.idea/
|
|
.vscode/
|
|
|
|
# OS
|
|
.DS_Store
|
|
Thumbs.db
|
|
|
|
# Build artifacts
|
|
*.app
|
|
*.exe
|
|
*.war
|
|
*.jar
|
|
target/
|
|
|
|
# Large media
|
|
*.mp4
|
|
*.tiff
|
|
*.avi
|
|
*.flv
|
|
*.mov
|
|
*.wmv
|
|
|
|
# Local data (GMAL Excel, sample RFPs etc. — populated per developer)
|
|
data/
|
|
backups/
|