Skip to content

feat(deploy): migrate compose-next to single-env deployment with profiles and prebuilt images#1759

Merged
MarceloRobert merged 1 commit intokernelci:mainfrom
nuclearcat:deploy-improvements
Feb 26, 2026
Merged

feat(deploy): migrate compose-next to single-env deployment with profiles and prebuilt images#1759
MarceloRobert merged 1 commit intokernelci:mainfrom
nuclearcat:deploy-improvements

Conversation

@nuclearcat
Copy link
Member

Refactor the deployment flow so docker-compose-next uses one shared environment file and supports cleaner production/staging profiles without local multi-file env wiring.

  • Replace fragmented env-file usage in docker-compose-next with a unified .env template and sensible defaults for IMAGE_* registry/tag values.
  • Add local DB profile (local-db) and command-enabled profile (with_commands) in docker-compose-next, including backend service command/entrypoint definitions.
  • Add ingester and pending_aggregations worker services behind with_commands, with proper SKIP_CRONJOBS configuration and spool/metrics wiring.
  • Move dashboard_db to profile-gated startup with explicit healthcheck and env-driven credentials for staging/local DB scenarios.
  • Update backend entrypoint to read DB_PASSWORD (supports Docker secret file flow via existing file_env) and remove inline DB_DEFAULT JSON env generation.
  • Update .env.example into a single, documented template for next-compose usage with clearer variable grouping and placeholders.
  • Add DEPLOYMENT.md documenting development, production, and staging compose flows, plus migration notes from legacy DB_DEFAULT_* variables to DB_*.

Comment on lines +15 to +35
## 1. Development (`docker-compose.yml`)

The development setup builds images locally and uses per-service `.env` files.

### Setup

```bash
# Copy all example env files
cp .env.example .env
cp .env.backend.example .env.backend
cp .env.db.example .env.db
cp .env.proxy.example .env.proxy
cp .env.ingester.example .env.ingester
cp .env.pending_aggregations.example .env.pending_aggregations

# Start all core services (builds images from source)
docker compose up --build -d

# Include ingester and aggregation processor
docker compose --profile=with_commands up --build -d
```
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Old instructions?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, seems i forgot to update it for latest iteration.

@nuclearcat nuclearcat marked this pull request as draft February 24, 2026 16:18
@nuclearcat
Copy link
Member Author

I amended PR:

  1. Framework Misidentification: Fixed DEPLOYMENT.md to correctly identify the frontend as Vite/React (not Next.js). I dont know why i thought it is next.js, maybe because of last vulnerability there got confused.
  2. API Connection Mechanism: Clarified that the dev server does not proxy requests and that the browser connects directly via VITE_API_BASE_URL.
  3. Missing Setup Step: Added instructions to copy dashboard/.env.example for local frontend development.
  4. Legacy Variable Removal: Cleaned up .env.backend.example to remove the outdated DB_DEFAULT_* variables.
  5. Docker Secrets: Correctly mapped the postgres_password_secret in docker-compose.yml.
  6. Unification Script Cleanup: Updated setup-dashboard-db.sh to remove legacy comments and docker-compose-next.yml to re-enable environment file support for the proxy service.
  7. Typo Fix: Corrected the Docker command in docs/Onboarding.md.

Many mistakes was spotted by Gemini AI.

@MarceloRobert MarceloRobert added the Docker Related to a docker setup label Feb 25, 2026
Copy link
Collaborator

@MarceloRobert MarceloRobert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, all seems to be running

Comment on lines +41 to +42
secrets:
- postgres_password_secret
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question: why do we need the password to be in a file? why not just use it as a secret individual environment variable?

Copy link
Contributor

@gustavobtflores gustavobtflores left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@gustavobtflores gustavobtflores marked this pull request as ready for review February 25, 2026 13:37
Copy link
Collaborator

@MarceloRobert MarceloRobert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nuclearcat It seems like you reverted some changes in the last push, such as the entrypoint for the ingester/pending_aggregations_processor, the next.js -> vite, and other documentations and settings

…iles and prebuilt images

Refactor the deployment flow so docker-compose-next uses one shared environment file and
supports cleaner production/staging profiles without local multi-file env wiring.

- Replace fragmented env-file usage in docker-compose-next with a unified .env template
  and sensible defaults for IMAGE_* registry/tag values.
- Add local DB profile (`local-db`) and command-enabled profile (`with_commands`) in
  docker-compose-next, including backend service command/entrypoint definitions.
- Add ingester and pending_aggregations worker services behind `with_commands`, with
proper SKIP_CRONJOBS configuration and spool/metrics wiring.
- Move dashboard_db to profile-gated startup with explicit healthcheck and env-driven
credentials for staging/local DB scenarios.
- Update backend entrypoint to read `DB_PASSWORD` (supports Docker secret file flow via existing `file_env`)
and remove inline `DB_DEFAULT` JSON env generation.
- Update `.env.example` into a single, documented template for next-compose usage with
clearer variable grouping and placeholders.
- Add `DEPLOYMENT.md` documenting development, production, and staging compose flows,
plus migration notes from legacy `DB_DEFAULT_*` variables to `DB_*`.

Signed-off-by: Denys Fedoryshchenko <denys.f@collabora.com>
Copy link
Collaborator

@MarceloRobert MarceloRobert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All good now

@MarceloRobert MarceloRobert added this pull request to the merge queue Feb 26, 2026
Merged via the queue into kernelci:main with commit e1be8a0 Feb 26, 2026
7 checks passed
@gustavobtflores gustavobtflores mentioned this pull request Mar 1, 2026
13 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Docker Related to a docker setup

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants