Skip to content

feat: dockerized environments, CI/CD pipeline, and enriched seed data#13

Merged
dzhhem merged 12 commits intomasterfrom
feat/docker-setup
Apr 24, 2026
Merged

feat: dockerized environments, CI/CD pipeline, and enriched seed data#13
dzhhem merged 12 commits intomasterfrom
feat/docker-setup

Conversation

@dzhhem
Copy link
Copy Markdown
Collaborator

@dzhhem dzhhem commented Apr 24, 2026

Overview

This PR delivers a production-ready containerization stack, a revamped CI/CD pipeline, and a comprehensive seed dataset for local development.


What's Changed

🐳 Docker & Infrastructure

  • compose.dev.yaml — full dev stack with hot-reload, named volumes, pgAdmin, Prisma Studio port, and a runner service for one-off CLI tasks
  • compose.yaml — production stack behind Nginx (port 8080), with health checks and restart: unless-stopped
  • Multi-stage Dockerfiles for api, bot, and web — minimal Alpine-based images with optimized layer caching
  • Nginx reverse proxy (nginx/nginx.conf) — single entry point routing /api/, /api-docs, and /FinTrack/ with shared proxy_headers.conf
  • /api/health endpoint added for Docker health checks

🛠️ dx CLI

  • Universal dx script wrapping docker compose for both dev and prod lifecycles
  • Smart Proxy — scripts containing dx run on the host; others are forwarded to the runner container automatically
  • Supports setup, dev, prod, shell, run, logs, ps, and p-prefixed prod variants

⚙️ CI/CD

  • Refactored GitHub Actions into parallel specialized jobs: validate-env, migration-check, lint-and-format, type-check, security, test
  • Composite reusable actions: setup-node, turbo-cache
  • gate.yml — blocks release if CI fails; triggers release on success
  • release.yml — builds and pushes Docker images to GHCR with Trivy vulnerability scanning (CRITICAL/HIGH) for all three services

🗄️ Database Scripts

  • db-dump.sh and db-restore.sh hardened: Docker auto-detection, safe schema reset (drops tables and enums individually), Prisma ?schema= param stripping
  • New --clean flag for schema-only wipe without restore
  • New npm scripts: db:setup, db:reset and their :dx Docker variants

🌱 Seed Data

  • Expanded seed with 7 user profiles covering all access tiers (admin, donor, expired donor, limited, unverified, telegram)
  • Rich transaction history spanning day/week/month/year ranges for dashboard chart coverage
  • AI message history, donation payments, and error logs seeded for realistic admin panel testing
  • Password changed to 11111111 for all accounts

🔧 Misc

  • SWAGGER_SERVER_URL env var for contextual Swagger URL (local vs Docker vs prod)
  • Prisma Studio bound to 0.0.0.0 for Docker port forwarding
  • Bot start/dev scripts simplified (removed dotenv-cli wrapping)

dzhhem added 12 commits April 17, 2026 23:56
1. Infrastructure & Orchestration:
  * Introduced compose.dev.yaml for isolated development with hot-reload support.
  * Updated compose.yaml for stable production deployment.
  * Implemented dx — a universal CLI tool for Docker lifecycle management and command proxying.
  * Created a specialized Dockerfile.runner for administrative tasks (migrations, seeds, dumps) in an isolated environment.

2. API & Backend:
  * Refactored Dockerfiles to use multi-stage builds and optimized image sizes.
  * Configured contextual isolation (working_dir) for each service to enhance in-container development.
  * Added support for dynamic Swagger URLs via the SWAGGER_SERVER_URL environment variable.
  * Automated Prisma migrations during production container startup.

3. Frontend (Web):
  * Configured basePath: "/FinTrack" in Next.js for correct operation behind the reverse proxy.
  * Optimized healthchecks using 127.0.0.1 to resolve IPv6 issues in Alpine-based images.

4. Network & Proxy (Nginx):
  * Implemented Nginx as a single entry point (Reverse Proxy) on port 8080.
  * Refactored shared proxy headers into proxy_headers.conf for a cleaner configuration.
  * Added automatic redirection from the root / to /FinTrack/.

5. Database & Prisma:
  * Configured Prisma Studio to bind to all network interfaces (0.0.0.0).
  * Managed port exposures to allow concurrent command execution without conflicts.
* Refactored CI pipeline into specialized parallel jobs (lint, type-check, security, test).
* Introduced composite actions for Node.js setup and Turborepo caching to improve performance and maintainability.
* Added Prisma schema drift detection and environment variable documentation validation.
* Implemented automated Docker image builds for GHCR with integrated Trivy security scanning.
* Configured workflow gating to ensure production releases only occur after successful CI verification.
* Improved dx CLI: Smart proxying and service shortcuts.
* Expanded Seed Data: Rich datasets for users, transactions, AI history, and logs.
* New Commands: Added db:setup and db:reset for quick environment initialization.
@BODMAT BODMAT self-requested a review April 24, 2026 07:51
@dzhhem dzhhem merged commit 552fff9 into master Apr 24, 2026
6 checks passed
@dzhhem dzhhem deleted the feat/docker-setup branch April 24, 2026 18:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants