feat: Add slcompose service orchestrator with Infisical secret injection
- Add slcompose.sh: Central orchestrator for managing all Docker services * Boot all services at startup with automated Infisical secret injection * Commands: up, down, restart, logs, logs-tail, env, env-all * Colored environment variable output (blue names, green values) - Add slcompose.service: Systemd service file for auto-boot on startup * Type=oneshot with RemainAfterExit=yes * Waits for Docker service before starting * Runs on multi-user.target - Add orchestration.md: Comprehensive documentation * Architecture and installation guide * Usage examples for all commands * Secret injection flow and troubleshooting * Performance and security notes - Update README.md and AI_CONTEXT.md * Document service orchestration architecture * Explain slcompose functionality and commands * Reference new orchestration documentation
This commit is contained in:
+29
-4
@@ -53,13 +53,38 @@ Xray -> Public tunneling endpoint through proxy network
|
||||
|
||||
## Secrets
|
||||
|
||||
Secrets are stored in:
|
||||
Secrets are stored in Infisical and injected at runtime via the **slcompose orchestrator**.
|
||||
|
||||
/srv/secrets/company.env
|
||||
Never hardcode credentials. All services receive environment variables through Infisical's secret injection at container startup.
|
||||
|
||||
Never hardcode credentials.
|
||||
### Secret Injection Flow
|
||||
|
||||
Always use env_file.
|
||||
The `slcompose` service orchestrator manages all Docker services with automated secret injection:
|
||||
|
||||
```bash
|
||||
slcompose boot # Boots all services with secrets injected
|
||||
slcompose up <service> # Start a service with secrets injected
|
||||
slcompose down <service> # Stop a service
|
||||
slcompose restart <service> # Restart a service
|
||||
slcompose logs <service> # Stream logs
|
||||
slcompose logs-tail <service> [lines] # View last N lines
|
||||
slcompose list # List all available services
|
||||
```
|
||||
|
||||
**System Startup:** The systemd service `slcompose.service` automatically runs `slcompose boot` on server reboot.
|
||||
|
||||
**Implementation:** See [docs/slcompose.sh](slcompose.sh) and [docs/slcompose.service](slcompose.service).
|
||||
|
||||
## Service Orchestration
|
||||
|
||||
All Docker services are managed through **slcompose**, which:
|
||||
|
||||
1. **Loads Infisical Token** from `/etc/infisical/token`
|
||||
2. **Discovers Services** by scanning `/srv/docker/` for directories with `docker-compose.yml`
|
||||
3. **Injects Secrets** using `infisical run --path=/[SERVICE_NAME]` before executing docker compose commands
|
||||
4. **Manages Lifecycle** with up, down, restart, and logs commands
|
||||
|
||||
Each service directory name (e.g., `/srv/docker/gitea`) becomes the Infisical path (e.g., `/gitea`) for secret lookup.
|
||||
|
||||
## Docker Networks
|
||||
|
||||
|
||||
Reference in New Issue
Block a user