Merge pull request 'flows fix' (#5) from dock into main

Reviewed-on: https://git.turbo-data.com/nprasad2077/docker-templates/pulls/5
This commit is contained in:
2026-09-19 06:27:52 +00:00
2 changed files with 75 additions and 44 deletions
+36 -44
View File
@@ -11,58 +11,50 @@ on:
jobs: jobs:
healthcheck: healthcheck:
runs-on: ubuntu-latest runs-on: ubuntu-latest
name: Code, dbt & Live App Health Check name: Compose Templates Health Check
steps: steps:
- name: Checkout Code - name: Checkout Code
uses: actions/checkout@v4 uses: actions/checkout@v4
- name: Install System Dependencies - name: Install System Dependencies
run: | run: |
apt-get update && apt-get install -y curl unzip git ca-certificates apt-get update && apt-get install -y python3 python3-yaml git ca-certificates
- name: Install uv - name: Validate Compose Templates & Workflows
run: | run: |
curl -LsSf https://astral.sh/uv/install.sh | sh echo "==> Validating all docker-compose.yml files..."
echo "$HOME/.local/bin" >> $GITHUB_PATH python3 - <<'PY'
echo "/root/.local/bin" >> $GITHUB_PATH import pathlib, sys
try:
- name: Install Project Dependencies import yaml
run: | except ImportError:
export PATH="$HOME/.local/bin:/root/.local/bin:$PATH" print("pyyaml missing"); sys.exit(1)
uv sync failures = []
files = sorted(pathlib.Path(".").glob("*/docker-compose.yml"))
- name: Python Syntax & Compilation Verification assert files, "no */docker-compose.yml found"
run: | for f in files:
export PATH="$HOME/.local/bin:/root/.local/bin:$PATH" try:
echo "==> Validating Python scripts compilation..." doc = yaml.safe_load(f.read_text())
uv run python -m py_compile streamlit_app/app.py scripts/db_storage.py except Exception as e:
echo "✓ Python scripts compiled without errors" failures.append(f"{f}: YAML parse error: {e}")
continue
- name: dbt Manifest & Model Validation if not isinstance(doc, dict) or "services" not in doc:
run: | failures.append(f"{f}: missing top-level 'services' key")
export PATH="$HOME/.local/bin:/root/.local/bin:$PATH" continue
echo "==> Validating dbt package dependencies..." for svc, cfg in doc["services"].items():
uv run dbt deps --project-dir dbt_nba --profiles-dir dbt_nba if not isinstance(cfg, dict) or "image" not in cfg:
echo "==> Validating dbt models, seeds, and tests compilation..." failures.append(f"{f}: service '{svc}' missing 'image'")
uv run dbt parse --project-dir dbt_nba --profiles-dir dbt_nba print(f"OK {f} services={list(doc['services'].keys())}")
echo "✓ All dbt models, seeds, and macros validated" for f in sorted(pathlib.Path(".gitea/workflows").glob("*.y*ml")):
try:
- name: Cloudflare R2 Storage Probe (Optional if secrets present) yaml.safe_load(f.read_text())
env: print(f"OK {f}")
S3_ENDPOINT_URL: ${{ secrets.S3_ENDPOINT_URL }} except Exception as e:
S3_BUCKET_NAME: ${{ secrets.S3_BUCKET_NAME }} failures.append(f"{f}: YAML parse error: {e}")
S3_ACCESS_KEY_ID: ${{ secrets.S3_ACCESS_KEY_ID }} if failures:
S3_SECRET_ACCESS_KEY: ${{ secrets.S3_SECRET_ACCESS_KEY }} print("FAILURES:"); [print(" -", x) for x in failures]; sys.exit(1)
S3_REGION: ${{ secrets.S3_REGION || 'auto' }} print("All templates validated")
S3_DB_KEY: ${{ secrets.S3_DB_KEY || 'dbt_nba.duckdb' }} PY
run: |
export PATH="$HOME/.local/bin:/root/.local/bin:$PATH"
if [ -n "${S3_ENDPOINT_URL:-}" ]; then
echo "==> Probing Cloudflare R2 storage status..."
uv run python scripts/db_storage.py status
else
echo "==> S3 secrets not configured for this step; skipping storage probe."
fi
- name: Live Production App Health Probe - name: Live Production App Health Probe
run: | run: |
+39
View File
@@ -0,0 +1,39 @@
services:
broker:
image: docker.io/library/redis:6.0
restart: unless-stopped
webserver:
image: ghcr.io/paperless-ngx/paperless-ngx:latest
ports:
- '8010:8000'
volumes:
- /data/paperless-ngx/data:/usr/src/paperless/data
- /data/paperless-ngx/media:/usr/src/paperless/media
- /data/paperless-ngx/export:/usr/src/paperless/export
- /data/paperless-ngx/consume:/usr/src/paperless/consume
- /data/paperless-ngx/redis/data:/data
environment:
PAPERLESS_REDIS: redis://broker:6379
USERMAP_UID: ${PUID}
USERMAP_GID: ${PGID}
PAPERLESS_TIME_ZONE: ${TZ}
PAPERLESS_URL: ${PAPERLESSURL}
PAPERLESS_SECRET_KEY: ${RANDOMKEY}
PAPERLESS_OCR_LANGUAGE: ${LANG}
PAPERLESS_ADMIN_USER: ${ADMIN_USER}
PAPERLESS_ADMIN_PASSWORD: ${ADMIN_PASS}
healthcheck:
test:
- CMD
- curl
- '-fs'
- '-S'
- '--max-time'
- '2'
- http://localhost:8000
interval: 30s
timeout: 10s
retries: 5
depends_on:
- broker
restart: unless-stopped