MEGA-BOQ-WEBAPP/docker-compose.yml
MEGA INFRA 7fd221288a Make the build marker actually report the build
It read 'dev' on the live site, so it was decoration rather than evidence.
Cause: Coolify does not pass a commit SHA into a Docker Compose build, so my
${BUILD_SHA:-dev} fallback always won.

Read from build.txt in the repo instead, which cannot drift from what is
deployed. Two things that took a try each:
- Docker's ENV does not evaluate $(cat file), so the file is copied into the
  image and read at startup.
- Streamlit executes app.py in an exec context where __file__ is not
  guaranteed; a bare reference to it inside build_sha() would have taken the
  whole app down. It now walks a list of candidate paths and never raises.

Verified: docker build ok; build.txt inside the image reads e1f4127;
build_sha() resolves to e1f4127 in the container; the sidebar renders it.
2026-10-02 21:57:13 +02:00

41 lines
1.3 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
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: