mirror of
https://github.com/johndoe6345789/metabuilder.git
synced 2026-04-24 13:54:57 +00:00
refactor: remove CLI references and update documentation for admin tools container
This commit is contained in:
@@ -13,7 +13,6 @@ All services are compiled automatically when you run `docker-compose up --build`
|
||||
| **Next.js App** | TypeScript | Node.js | ~2-5 min | Optimized JS bundle |
|
||||
| **DBAL Daemon** | C++17 | Conan + CMake + Ninja | ~5-10 min | `dbal_daemon` binary |
|
||||
| **Media Daemon** | C++17 | Conan + CMake + Ninja | ~8-15 min | `media_daemon` binary |
|
||||
| **CLI** | C++17 | Conan + CMake + Ninja | ~5-10 min | `metabuilder-cli` binary |
|
||||
| **Tools Container** | Multi | Node.js + C++ | ~15-20 min | Full toolkit |
|
||||
|
||||
**Total First Build**: ~25-40 minutes (cached layers make subsequent builds much faster)
|
||||
@@ -73,10 +72,9 @@ COPY --from=builder /build/build/dbal_daemon /app/dbal_daemon
|
||||
**What Gets Compiled**:
|
||||
- C++17 source code
|
||||
- Dependencies via Conan:
|
||||
- PostgreSQL client library
|
||||
- HTTP server (Boost.Beast or similar)
|
||||
- JSON parser
|
||||
- Lua interpreter
|
||||
- PostgreSQL client library
|
||||
- HTTP server (Boost.Beast or similar)
|
||||
- JSON parser
|
||||
- Links into single optimized binary
|
||||
|
||||
**Output**: `dbal_daemon` (~5-10 MB binary)
|
||||
@@ -133,68 +131,32 @@ COPY --from=builder /app/build/media_daemon /usr/local/bin/
|
||||
|
||||
---
|
||||
|
||||
### 4. CLI ✅
|
||||
|
||||
**Dockerfile**: [`docker/Dockerfile.cli`](docker/Dockerfile.cli)
|
||||
|
||||
**Build Steps**:
|
||||
```dockerfile
|
||||
# Stage 1: Builder
|
||||
FROM ubuntu:22.04 AS builder
|
||||
|
||||
# Install build tools
|
||||
RUN apt-get install build-essential cmake ninja-build
|
||||
RUN pip3 install conan && conan profile detect
|
||||
|
||||
# Build CLI
|
||||
WORKDIR /build/cli
|
||||
RUN conan install . --output-folder build --build missing
|
||||
RUN cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release
|
||||
RUN cmake --build build --config Release
|
||||
|
||||
# Stage 2: Runtime
|
||||
FROM ubuntu:22.04
|
||||
COPY --from=builder /build/cli/build/bin/metabuilder-cli /usr/local/bin/
|
||||
```
|
||||
|
||||
**What Gets Compiled**:
|
||||
- C++17 CLI application
|
||||
- Dependencies via Conan:
|
||||
- cpr (HTTP client)
|
||||
- lua (Lua 5.4 interpreter)
|
||||
- sol2 (C++/Lua binding)
|
||||
- nlohmann_json (JSON)
|
||||
|
||||
**Output**: `metabuilder-cli` binary
|
||||
|
||||
---
|
||||
|
||||
### 5. Tools Container ✅
|
||||
### 4. Tools Container ✅
|
||||
|
||||
**Dockerfile**: [`docker/Dockerfile.tools`](docker/Dockerfile.tools)
|
||||
|
||||
**Multi-stage Build**:
|
||||
**Build Steps**:
|
||||
```dockerfile
|
||||
# Stage 1: Node.js + Prisma
|
||||
FROM node:20-alpine AS node-builder
|
||||
RUN npm ci && npx prisma generate
|
||||
|
||||
# Stage 2: CLI builder (same as above)
|
||||
FROM ubuntu:22.04 AS cli-builder
|
||||
# ... compile CLI ...
|
||||
|
||||
# Stage 3: Combined runtime
|
||||
# Stage 2: Combined runtime
|
||||
FROM node:20-alpine
|
||||
COPY --from=node-builder /build/frontends/nextjs /app/nextjs
|
||||
COPY --from=cli-builder /build/cli/build/bin/metabuilder-cli /usr/local/bin/
|
||||
COPY --from=node-builder /build/prisma /app/prisma
|
||||
COPY seed/ /app/seed/
|
||||
COPY deployment/scripts/ /app/scripts/
|
||||
COPY packages/ /app/packages/
|
||||
```
|
||||
|
||||
**What Gets Compiled/Bundled**:
|
||||
**What Gets Bundled**:
|
||||
- Prisma client (TypeScript → Node.js bindings)
|
||||
- MetaBuilder CLI (C++)
|
||||
- All npm dependencies
|
||||
- Seed data + bootstrap scripts
|
||||
- Package assets for admin tooling
|
||||
- Node.js/Next.js tooling
|
||||
|
||||
**Output**: Complete admin toolkit with both Node.js and C++ tools
|
||||
**Output**: Complete admin toolkit with Node.js tools and migration helpers
|
||||
|
||||
---
|
||||
|
||||
@@ -210,7 +172,6 @@ All C++ projects use Conan for dependency management:
|
||||
boost/1.82.0
|
||||
libpq/15.3
|
||||
nlohmann_json/3.11.2
|
||||
lua/5.4.6
|
||||
|
||||
[generators]
|
||||
CMakeDeps
|
||||
|
||||
@@ -179,20 +179,19 @@ docker-compose -f deployment/docker/docker-compose.monitoring.yml up -d
|
||||
docker-compose -f deployment/docker/docker-compose.development.yml up
|
||||
```
|
||||
|
||||
### 4. CLI & Tools Container
|
||||
### 4. Admin Tools Container
|
||||
|
||||
**Dockerfiles**:
|
||||
- [`Dockerfile.cli`](docker/Dockerfile.cli) - Standalone CLI
|
||||
- [`Dockerfile.tools`](docker/Dockerfile.tools) - Admin tools + CLI
|
||||
**Dockerfile**:
|
||||
- [`Dockerfile.tools`](docker/Dockerfile.tools) - Admin toolkit with Node.js, migrations, and scripts
|
||||
|
||||
**Usage**:
|
||||
```bash
|
||||
# Build tools container
|
||||
docker build -f deployment/docker/Dockerfile.tools -t metabuilder-tools .
|
||||
|
||||
# Run CLI command
|
||||
# Run administrative script (bootstrap, backup, etc.)
|
||||
docker run --rm --network metabuilder_metabuilder-network \
|
||||
metabuilder-tools metabuilder-cli package list
|
||||
metabuilder-tools /app/scripts/bootstrap-system.sh
|
||||
|
||||
# Interactive shell
|
||||
docker run -it --rm --network metabuilder_metabuilder-network \
|
||||
@@ -629,7 +628,6 @@ docker network inspect metabuilder_metabuilder-network
|
||||
- [Seed System](../seed/README.md) - Bootstrap and package installation
|
||||
- [DBAL Documentation](../dbal/README.md) - Database abstraction layer
|
||||
- [Package System](../README.md#package-system) - Package architecture
|
||||
- [CLI Documentation](../frontends/cli/README.md) - Command-line interface
|
||||
|
||||
---
|
||||
|
||||
|
||||
@@ -10,19 +10,12 @@ Complete deployment infrastructure for MetaBuilder with 19 configuration files a
|
||||
|
||||
### 1. Docker Containers
|
||||
|
||||
**CLI Container** ([`docker/Dockerfile.cli`](docker/Dockerfile.cli))
|
||||
- Standalone MetaBuilder CLI (C++ binary)
|
||||
- Lua runtime for package scripts
|
||||
- HTTP client for API communication
|
||||
- Minimal Ubuntu 22.04 runtime
|
||||
|
||||
**Tools Container** ([`docker/Dockerfile.tools`](docker/Dockerfile.tools))
|
||||
- MetaBuilder CLI
|
||||
- Node.js + Prisma client
|
||||
- Database migration tools
|
||||
- Bootstrap and seed scripts
|
||||
- PostgreSQL client utilities
|
||||
- Combined Node.js and C++ tooling
|
||||
- Combined admin tooling with migration helpers
|
||||
|
||||
### 2. Deployment Stacks
|
||||
|
||||
@@ -186,8 +179,7 @@ Tools container includes:
|
||||
|
||||
| File | Purpose | Base Image |
|
||||
|------|---------|------------|
|
||||
| `Dockerfile.cli` | CLI-only container | ubuntu:22.04 |
|
||||
| `Dockerfile.tools` | Admin tools + CLI | node:20-alpine |
|
||||
| `Dockerfile.tools` | Admin tools & migration toolkit | node:20-alpine |
|
||||
| `Dockerfile.app` | Production app (existing) | node:20-alpine |
|
||||
| `Dockerfile.app.dev` | Development app (existing) | node:20 |
|
||||
|
||||
@@ -465,9 +457,9 @@ docker-compose -f deployment/docker/docker-compose.production.yml restart [servi
|
||||
# Shell access
|
||||
docker-compose -f deployment/docker/docker-compose.production.yml exec [service] sh
|
||||
|
||||
# Run CLI command
|
||||
# Run admin script (bootstrap, backup, etc.)
|
||||
docker-compose -f deployment/docker/docker-compose.production.yml \
|
||||
run --rm metabuilder-tools metabuilder-cli [command]
|
||||
run --rm metabuilder-tools /app/scripts/your-script.sh
|
||||
```
|
||||
|
||||
### Maintenance
|
||||
@@ -526,7 +518,6 @@ docker-compose -f deployment/docker/docker-compose.production.yml ps
|
||||
- [Complete Deployment Guide](DEPLOYMENT_GUIDE.md)
|
||||
- [Original README](README.md)
|
||||
- [Seed System](../seed/README.md)
|
||||
- [CLI Documentation](../frontends/cli/README.md)
|
||||
- [DBAL Documentation](../dbal/README.md)
|
||||
- [Main Project README](../README.md)
|
||||
|
||||
|
||||
@@ -4,10 +4,9 @@
|
||||
|
||||
## New Services & Features
|
||||
|
||||
### 1. CLI & Admin Tools Container
|
||||
### 1. Admin Tools Container
|
||||
|
||||
**Dockerfiles**:
|
||||
- [`docker/Dockerfile.cli`](docker/Dockerfile.cli) - Standalone MetaBuilder CLI
|
||||
**Dockerfile**:
|
||||
- [`docker/Dockerfile.tools`](docker/Dockerfile.tools) - Complete admin toolkit
|
||||
|
||||
**Build & Run**:
|
||||
@@ -15,9 +14,9 @@
|
||||
# Build tools container
|
||||
docker build -f deployment/docker/Dockerfile.tools -t metabuilder-tools .
|
||||
|
||||
# Run CLI commands
|
||||
# Run admin script (bootstrap, backup, etc.)
|
||||
docker run --rm --network metabuilder_metabuilder-network \
|
||||
metabuilder-tools metabuilder-cli package list
|
||||
metabuilder-tools /app/scripts/bootstrap-system.sh
|
||||
|
||||
# Interactive admin shell
|
||||
docker run -it --rm --network metabuilder_metabuilder-network \
|
||||
@@ -25,11 +24,10 @@ docker run -it --rm --network metabuilder_metabuilder-network \
|
||||
```
|
||||
|
||||
**Included Tools**:
|
||||
- MetaBuilder CLI (C++ binary)
|
||||
- Node.js tools and Prisma client
|
||||
- Database migration scripts
|
||||
- Bootstrap and seed scripts
|
||||
- PostgreSQL client tools
|
||||
- PostgreSQL client utilities
|
||||
|
||||
### 2. System Bootstrap
|
||||
|
||||
@@ -143,7 +141,6 @@ deployment/
|
||||
│ ├── docker-compose.monitoring.yml # NEW: Monitoring stack
|
||||
│ ├── Dockerfile.app # App dockerfile (original)
|
||||
│ ├── Dockerfile.app.dev # Dev app dockerfile (original)
|
||||
│ ├── Dockerfile.cli # NEW: CLI-only container
|
||||
│ └── Dockerfile.tools # NEW: Admin tools container
|
||||
│
|
||||
├── config/
|
||||
@@ -340,7 +337,6 @@ docker-compose -f deployment/docker/docker-compose.production.yml exec postgres
|
||||
- [DEPLOYMENT_GUIDE.md](DEPLOYMENT_GUIDE.md) - Complete deployment guide
|
||||
- [Main README.md](README.md) - Original deployment documentation
|
||||
- [Seed README](../seed/README.md) - Bootstrap system documentation
|
||||
- [CLI Documentation](../frontends/cli/README.md) - CLI tool usage
|
||||
|
||||
---
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# MetaBuilder Tools/Admin Container
|
||||
# Includes CLI, migrations, seed scripts, and administrative tools
|
||||
# Includes migrations, seed scripts, and administrative tools
|
||||
# Build: docker build -f deployment/docker/Dockerfile.tools -t metabuilder-tools .
|
||||
# Run: docker run -it --rm --network metabuilder_network metabuilder-tools
|
||||
|
||||
@@ -7,7 +7,7 @@ FROM node:20-alpine AS node-builder
|
||||
|
||||
WORKDIR /build
|
||||
|
||||
# Copy frontend for migration tools
|
||||
# Install Node dependencies for Next.js
|
||||
COPY frontends/nextjs/package*.json ./frontends/nextjs/
|
||||
RUN cd frontends/nextjs && npm ci
|
||||
|
||||
@@ -17,32 +17,6 @@ COPY prisma/ ./prisma/
|
||||
# Build Prisma client
|
||||
RUN cd frontends/nextjs && npx prisma generate
|
||||
|
||||
# === CLI Builder ===
|
||||
FROM ubuntu:22.04 AS cli-builder
|
||||
|
||||
RUN apt-get update && apt-get install -y \
|
||||
build-essential \
|
||||
cmake \
|
||||
ninja-build \
|
||||
python3 \
|
||||
python3-pip \
|
||||
git \
|
||||
curl \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
RUN pip3 install --no-cache-dir conan
|
||||
RUN conan profile detect --force
|
||||
|
||||
WORKDIR /build
|
||||
|
||||
COPY frontends/cli/ ./cli/
|
||||
|
||||
WORKDIR /build/cli
|
||||
RUN conan install . --output-folder build --build missing --settings=build_type=Release
|
||||
RUN cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=build/conan_toolchain.cmake
|
||||
RUN cmake --build build --config Release
|
||||
|
||||
# === Final Tools Image ===
|
||||
FROM node:20-alpine
|
||||
|
||||
# Install additional tools
|
||||
@@ -59,14 +33,10 @@ RUN adduser -D -s /bin/bash metabuilder
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# Copy Node.js tools and Prisma
|
||||
# Copy Node.js tools and Prisma artifacts
|
||||
COPY --from=node-builder /build/frontends/nextjs /app/nextjs
|
||||
COPY --from=node-builder /build/prisma /app/prisma
|
||||
|
||||
# Copy CLI binary
|
||||
COPY --from=cli-builder /build/cli/build/bin/metabuilder-cli /usr/local/bin/metabuilder-cli
|
||||
RUN chmod +x /usr/local/bin/metabuilder-cli
|
||||
|
||||
# Copy seed data and scripts
|
||||
COPY seed/ /app/seed/
|
||||
COPY deployment/scripts/ /app/scripts/
|
||||
|
||||
Reference in New Issue
Block a user