development.toml RawHistoryFolder
1# Gordon v2 - Development Configuration Example
2# For local development and testing
3
4[server]
5port = 8080
6registry_port = 5000
7registry_domain = "registry.yourdomain.com" # Your Gordon registry domain
8runtime = "auto" # auto-detects Docker/Podman
9ssl_email = "dev@localhost"
10data_dir = "./dev-data"
11
12# Secrets backend for development
13[secrets]
14backend = "unsafe" # Plain text storage for local development
15
16[registry_auth]
17enabled = false # Disable auth for easier local development
18
19# To enable auth for development:
20# enabled = true
21# type = "password"
22# username = "dev"
23# password_hash = "gordon/registry/password_hash" # Generate: gordon auth password hash
24
25[auto_route]
26enabled = true # Enable automatic route creation from image names
27
28# Volume configuration - auto-creates persistent storage from VOLUME directives
29[volumes]
30auto_create = true # Default: true (automatically handle VOLUME directives)
31prefix = "gordon" # Default: "gordon" (volume name prefix)
32preserve = true # Default: true (keep volumes when containers are removed)
33
34# Logging configuration for development
35[logging]
36enabled = true # Enable file-based logging
37level = "debug" # Verbose logging for development
38dir = "./dev-data/logs" # Store logs in dev data directory
39main_log_file = "gordon.log" # Main application logs
40proxy_log_file = "proxy.log" # HTTP proxy traffic logs
41container_log_dir = "containers" # Container logs subdirectory
42
43# Log rotation settings - smaller for development
44max_size = 10 # Max 10MB per log file
45max_backups = 3 # Keep 3 old files
46max_age = 7 # Keep logs for 1 week
47compress = true # Compress old logs
48
49# Environment variables configuration
50[env]
51# Directory where .env files are stored for each route
52dir = "./dev-data/env"
53# Note: Secret providers use [secrets].backend configuration
54
55# Development routes using your domain
56[routes]
57"app.yourdomain.com" = "myapp:latest" # Main app - latest build
58"api.yourdomain.com" = "myapi:latest" # API service
59"admin.yourdomain.com" = "admin:latest" # Admin interface
60"docs.yourdomain.com" = "docs:latest" # Documentation
61
62# Test different versions
63"app-v1.yourdomain.com" = "myapp:v1.0.0" # Test older version
64"app-v2.yourdomain.com" = "myapp:v2.0.0" # Test newer version
65
66# Third-party services for development
67"db-admin.yourdomain.com" = "phpmyadmin:latest" # Database admin
68"mail.yourdomain.com" = "mailhog/mailhog:latest" # Email testing
69
70# Network isolation configuration
71[network_isolation]
72enabled = true # Enable per-app network isolation
73network_prefix = "gordon" # Default prefix for network names
74dns_suffix = ".internal" # DNS suffix for internal services
75
76# Service attachments - each app gets its own isolated network with attached services
77[attachments]
78"app.yourdomain.com" = ["my-postgres:latest", "my-redis:latest"] # App with database and cache
79"api.yourdomain.com" = ["my-postgres:latest"] # API with its own database
80"admin.yourdomain.com" = ["my-mysql:latest"] # Admin with different database
81
82# Optional: Network groups for shared services between apps
83# [network_groups]
84# "backend" = ["app.yourdomain.com", "api.yourdomain.com"] # Share services between app and api
85#
86# [attachments]
87# "backend" = ["my-redis:latest", "rabbitmq:latest"] # Shared cache and queue
88# "app.yourdomain.com" = ["my-postgres:latest"] # App-specific database
89# "api.yourdomain.com" = ["my-postgres:latest"] # API-specific database
90# "admin.yourdomain.com" = ["my-mysql:latest"] # Admin gets its own isolated network
91
92# Environment Variables Usage:
93#
94# For development, create .env files for your routes:
95# ./dev-data/env/app_yourdomain_com.env
96# ./dev-data/env/api_yourdomain_com.env
97#
98# Example env file content:
99# NODE_ENV=development
100# DEBUG=true
101# DATABASE_URL=postgresql://localhost:5432/dev
102# API_KEY=${pass:dev/api-key} # Optional: use pass for dev secrets
103
104# Development workflow:
105# 1. Point DNS to your Gordon server:
106# A *.yourdomain.com → YOUR_GORDON_SERVER_IP
107# A yourdomain.com → YOUR_GORDON_SERVER_IP
108#
109# 2. Build your app: docker build -t myapp:latest .
110# 3. Create env file: ./dev-data/env/app_yourdomain_com.env
111# 4. Push to Gordon registry:
112# docker tag myapp:latest registry.yourdomain.com/myapp:latest
113# docker push registry.yourdomain.com/myapp:latest
114# 5. Access at https://app.yourdomain.com
115#
116# AUTO-ROUTE FEATURE:
117# With auto_route.enabled = true, you can also push images with domain names as image names:
118# docker build -t myapp .
119# docker tag myapp:latest registry.yourdomain.com/mytestapp.bamen.dev:latest
120# docker push registry.yourdomain.com/mytestapp.bamen.dev:latest
121# Gordon will automatically create a route for mytestapp.bamen.dev -> mytestapp.bamen.dev:latest
122#
123# VOLUME FEATURE:
124# Add VOLUME directives to your Dockerfile for automatic persistent storage:
125# VOLUME ["/app/data", "/app/uploads"]
126# Gordon automatically creates and mounts persistent volumes - no config needed!
127#
128# ENV DIRECTIVE FEATURE:
129# Add ENV directives to your Dockerfile for default environment variables:
130# ENV NODE_ENV=production
131# ENV PORT=3000
132# ENV LOG_LEVEL=info
133# Gordon automatically reads these and merges them with your .env files!
134# Your .env files always override Dockerfile ENV directives.
135#
136# Example Dockerfile with both features:
137# FROM node:18-alpine
138# WORKDIR /app
139# ENV NODE_ENV=production
140# ENV PORT=3000
141# VOLUME ["/app/data", "/app/logs"]
142# COPY . .
143# EXPOSE 3000
144# CMD ["npm", "start"]
145#
146# Cloudflare handles SSL and DNS for your remote Gordon server!
147#
148# NETWORK ISOLATION FEATURE:
149# With attachments, each app gets its own isolated network with attached services.
150# Services are accessible by their simple names within the network:
151# - postgresql://postgres:5432/mydb
152# - redis://redis:6379
153# - mysql://mysql:3306/mydb
154#
155# To use persistent storage with attachments, create custom Dockerfiles:
156#
157# Example my-postgres Dockerfile:
158# FROM postgres:15
159# VOLUME ["/var/lib/postgresql/data"]
160# ENV POSTGRES_DB=myapp
161# ENV POSTGRES_USER=appuser
162# ENV POSTGRES_PASSWORD=secret
163#
164# Build and push to registry:
165# docker build -f Dockerfile.postgres -t registry.yourdomain.com/my-postgres:latest .
166# docker push registry.yourdomain.com/my-postgres:latest