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