Files
asepharyana-hub/infra
asephsandClaude Opus 4.8 76ccc5ffe9 chore: migrate from ESLint/Prettier to Biome
- Add biome.json with recommended preset + custom rules
- Remove eslint.config.mjs (root, apps/react, apps/elysia)
- Remove .prettierrc and .prettierignore
- Update package.json: remove eslint/prettier deps, add biome scripts
- Update Makefile: lint/format targets to biome
- Update CI (lint.yml): eslint -> biome ci
- Update VSCode config: biomejs.biome extension + default formatter
- Apply biome format --write to all files
- Update submodule pointers for react and elysia

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-10 05:42:53 +07:00
..
2026-07-09 22:08:26 +07:00
2026-07-09 22:08:26 +07:00

Infrastructure

Docker Compose and Traefik configuration for asepharyana-hub.

Layout

infra/
├── compose/                 # One compose file per stack/service
│   ├── traefik.yml          # Public reverse proxy
│   ├── shared.yml           # Shared Redis
│   ├── react.yml            # React SPA
│   ├── scraper.yml          # Scraper API
│   ├── elysia.yml           # Elysia API
│   └── rust-auth.yml        # Rust auth API
├── docker/                  # Dockerfiles and image runtime helpers
├── traefik/                 # Static and dynamic Traefik configuration
│   ├── dynamic/             # Routers, services, middlewares, TLS certs
│   └── TRAEFIK_ENV_CONFIG.md
└── config/                  # Service bootstrap configuration

Archived configs that are not deployed live under docs/config/.

First-time setup

Create the shared Docker network before starting any service:

docker network create app-shared-net

Create .env from .env.example and fill production values. Do not commit .env.

Deployment order

The GitHub deploy workflow combines the active compose files automatically. For manual deployment, use this order:

docker compose -f infra/compose/shared.yml up -d
docker compose -f infra/compose/traefik.yml up -d

docker compose \
  -f infra/compose/react.yml \
  -f infra/compose/scraper.yml \
  -f infra/compose/elysia.yml \
  -f infra/compose/rust-auth.yml \
  up -d

Environment variables

Common variables used by infra compose files:

DATABASE_URL=
GITHUB_TOKEN=
JWT_SECRET=
SHARED_REDIS_EXPOSE=127.0.0.1:6379:6379

Traefik certificate path variables are optional because infra/compose/traefik.yml provides production-compatible defaults. See infra/traefik/TRAEFIK_ENV_CONFIG.md for the full list.

Traefik

Traefik reads dynamic config from infra/traefik/dynamic/:

  • apps.yaml — routers and upstream services
  • middlewares.yaml — shared middleware chains
  • ssl.yaml — TLS certificates

The primary certificate intentionally pairs asephstech.pem with asephscloud.key to preserve the current production layout.

Validation

Run syntax checks after editing infra YAML:

python - <<'PY'
import pathlib, yaml
for path in pathlib.Path('infra').rglob('*.yml'):
    with path.open() as fh:
        yaml.safe_load(fh)
    print(f'OK {path}')
for path in pathlib.Path('infra').rglob('*.yaml'):
    with path.open() as fh:
        yaml.safe_load(fh)
    print(f'OK {path}')
PY

Check compose rendering when Docker is available:

for f in infra/compose/*.yml; do
  docker compose -f "$f" config >/dev/null && echo "OK $f"
done