Support multiple domains with Traefik and automatic HTTPS #5
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR implements support for multiple domains with automatic HTTPS/TLS certificate generation using Traefik reverse proxy and Let's Encrypt.
Fixes #1
Changes
🚀 New Files
docker-compose.prod.yml- Production Docker Compose configuration.env.example- Environment variable templateREADME-deployment.md- Comprehensive deployment guide🔧 Modified Files
.gitignore- Updated to allow docker-compose.prod.yml while protecting sensitive dataSupported Domains
All the following domains are configured with automatic HTTPS and point to the same API Gateway service:
api.deep.assistant.run.placeapi-deep-assistant.mooo.comapi-deep-assistant.yee.pwassistant.yee.pwapi-deep-assistant.duckdns.orgAll domains resolve to:
173.212.230.201Technical Details
Architecture
Key Features
✅ Automatic SSL Certificates
./letsencrypt/acme.json✅ Multiple Domain Support
✅ HTTP to HTTPS Redirects
✅ Traefik Dashboard
https://traefik.api.deep.assistant.run.placeadmin, password:change_this_password)✅ Environment-Based Configuration
.envfile (not committed to Git).env.exampleDeployment
Quick Start
Clone the repository and checkout this branch:
git clone https://github.com/deep-assistant/api-gateway.git cd api-gateway git checkout issue-1-9255701be424Create
.envfile from template:Edit
.envwith your configuration:At minimum, configure:
LETSENCRYPT_EMAIL- Your email for Let's Encrypt notificationsADMIN_FIRST- Your master token for admin operationsOPENAI_API_KEY)Deploy the stack:
Verify deployment:
Test the API:
For detailed deployment instructions, see README-deployment.md.
Configuration Validation
The configuration has been validated:
✓ Docker Compose YAML syntax is valid
✓ Found 2 services: api-gateway, traefik
✓ Found 5 HTTPS domain routers configured
✓ Found 5 HTTP→HTTPS redirect routers configured
✓ Found 5 TLS/SSL certificate configurations
✓ Total labels on api-gateway: 37
✓ Total labels on traefik: 9
✓ Traefik dashboard configuration validated
✓ Network configuration validated
Security Considerations
🔒 Default Security Measures:
.envfile excluded from GitBefore production deployment, you MUST:
admin:change_this_password)ADMIN_FIRSTmaster tokenSee README-deployment.md for detailed security instructions.
Testing Checklist
Documentation
📖 Deployment Guide: README-deployment.md
📋 Environment Template: .env.example
🏗️ Architecture: ARCHITECTURE.md
Next Steps
After merging this PR:
Deploy to production server:
.envfile with production valuesdocker-compose -f docker-compose.prod.yml up -dVerify SSL certificates:
docker-compose -f docker-compose.prod.yml logs traefik | grep -i certificateSecurity hardening:
Optional enhancements:
Related Issues
🤖 Generated with Claude Code