MEGA-BOQ-WEBAPP/docker-compose.yml
MEGA INFRA f965e0cc93 Make the consultant profile actually apply, and show the build
The profile store was write-only: the app saved each consultant's detected
column map and displayed it, but every run re-detected from scratch. So the
original promise - drop their file in and it knows the format - wasn't kept,
and worse, the sidebar could show a stale map that didn't match the file in
front of you.

Now the saved map is applied, with two guards:
- it is only used when the columns it names still exist and still make sense
  for THIS file, so a template that changed shape falls back to detection
- 'Re-detect from scratch' in the sidebar overrides it deliberately

The hint path runs the same data verification and description-run derivation as
the fresh path. Without that a warm run placed 194 lines and a cold one placed
192 - both defensible, but a converter that gives two answers to the same pair
of files cannot be trusted on a tender. Cold and warm are now identical on both
sample pairs.

Also: the build SHA is baked in at image build time and shown in the sidebar,
because 'is my deploy current?' is otherwise unanswerable from outside -
Streamlit serves a client-rendered shell, so curl cannot see which commit is
serving.
2026-10-02 20:54:02 +02:00

44 lines
1.4 KiB
YAML

# MEGA INFRA · BOQ Converter
#
# Deploy on Coolify: New Resource -> Docker Compose -> point it at this repo
# and set the compose file to `docker-compose.yml`. Coolify builds the image
# from the Dockerfile, publishes the port, and puts its own HTTPS in front.
services:
boq-converter:
build:
context: .
dockerfile: Dockerfile
args:
# Coolify substitutes the commit it is building
BUILD_SHA: "${BUILD_SHA:-dev}"
image: mega-infra/boq-converter:latest
container_name: mega-boq-converter
restart: unless-stopped
# Coolify routes to the first exposed port. Declaring it explicitly stops
# it guessing from the Dockerfile.
expose:
- "8501"
environment:
# Where the per-consultant layout profiles are written. MUST be on the
# volume below or every redeploy forgets who is who.
BOQ_PROFILES: /data/profiles
STREAMLIT_BROWSER_GATHER_USAGE_STATS: "false"
TZ: Africa/Johannesburg
volumes:
# Named volume, so saved consultant profiles survive a rebuild. Without
# this the "remember this consultant's layout" feature resets every deploy.
- boq-profiles:/data/profiles
healthcheck:
test: ["CMD", "curl", "-fsS", "http://localhost:8501/_stcore/health"]
interval: 30s
timeout: 5s
retries: 3
start_period: 20s
volumes:
boq-profiles: