fix(compose): add traefik.docker.network=coolify label for correct container routing
When a container is on multiple networks, Traefik needs explicit instruction on which network to use for proxying. Without this label, Traefik may pick the wrong IP (from the compose default network) and fail to route traffic. Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
parent
df9f359c83
commit
1ed91f715b
1 changed files with 3 additions and 11 deletions
|
|
@ -8,18 +8,14 @@ services:
|
||||||
PORT: 3000
|
PORT: 3000
|
||||||
HOST: 0.0.0.0
|
HOST: 0.0.0.0
|
||||||
LOG_LEVEL: info
|
LOG_LEVEL: info
|
||||||
# Database connection (use Coolify-managed PostgreSQL)
|
|
||||||
POSTGRES_HOST: ${POSTGRES_HOST:-postgres}
|
POSTGRES_HOST: ${POSTGRES_HOST:-postgres}
|
||||||
POSTGRES_PORT: ${POSTGRES_PORT:-5432}
|
POSTGRES_PORT: ${POSTGRES_PORT:-5432}
|
||||||
POSTGRES_USER: ${POSTGRES_USER:-agenthub}
|
POSTGRES_USER: ${POSTGRES_USER:-agenthub}
|
||||||
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
|
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
|
||||||
POSTGRES_DB: ${POSTGRES_DB:-agenthub}
|
POSTGRES_DB: ${POSTGRES_DB:-agenthub}
|
||||||
# Redis connection (use Coolify-managed Redis)
|
|
||||||
REDIS_HOST: ${REDIS_HOST:-redis}
|
REDIS_HOST: ${REDIS_HOST:-redis}
|
||||||
REDIS_PORT: ${REDIS_PORT:-6379}
|
REDIS_PORT: ${REDIS_PORT:-6379}
|
||||||
# JWT secret for authentication
|
|
||||||
JWT_SECRET: ${JWT_SECRET}
|
JWT_SECRET: ${JWT_SECRET}
|
||||||
# CORS allowed origins
|
|
||||||
ALLOWED_ORIGINS: ${ALLOWED_ORIGINS:-https://agenthub.barodine.net}
|
ALLOWED_ORIGINS: ${ALLOWED_ORIGINS:-https://agenthub.barodine.net}
|
||||||
networks:
|
networks:
|
||||||
- default
|
- default
|
||||||
|
|
@ -31,17 +27,17 @@ services:
|
||||||
condition: service_started
|
condition: service_started
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
labels:
|
labels:
|
||||||
# Coolify labels for reverse proxy
|
|
||||||
- 'coolify.managed=true'
|
- 'coolify.managed=true'
|
||||||
- 'coolify.name=agenthub'
|
- 'coolify.name=agenthub'
|
||||||
- 'coolify.type=application'
|
- 'coolify.type=application'
|
||||||
# Enable HTTPS and WebSocket support
|
|
||||||
- 'traefik.enable=true'
|
- 'traefik.enable=true'
|
||||||
|
# Tell Traefik which Docker network to use for routing
|
||||||
|
- 'traefik.docker.network=coolify'
|
||||||
|
# HTTPS router for agenthub.barodine.net
|
||||||
- 'traefik.http.routers.agenthub.rule=Host(`agenthub.barodine.net`)'
|
- 'traefik.http.routers.agenthub.rule=Host(`agenthub.barodine.net`)'
|
||||||
- 'traefik.http.routers.agenthub.entrypoints=websecure'
|
- 'traefik.http.routers.agenthub.entrypoints=websecure'
|
||||||
- 'traefik.http.routers.agenthub.tls=true'
|
- 'traefik.http.routers.agenthub.tls=true'
|
||||||
- 'traefik.http.routers.agenthub.tls.certresolver=letsencrypt'
|
- 'traefik.http.routers.agenthub.tls.certresolver=letsencrypt'
|
||||||
# WebSocket support
|
|
||||||
- 'traefik.http.services.agenthub.loadbalancer.server.port=3000'
|
- 'traefik.http.services.agenthub.loadbalancer.server.port=3000'
|
||||||
- 'traefik.http.middlewares.agenthub-headers.headers.customrequestheaders.X-Forwarded-Proto=https'
|
- 'traefik.http.middlewares.agenthub-headers.headers.customrequestheaders.X-Forwarded-Proto=https'
|
||||||
- 'traefik.http.routers.agenthub.middlewares=agenthub-headers'
|
- 'traefik.http.routers.agenthub.middlewares=agenthub-headers'
|
||||||
|
|
@ -95,7 +91,6 @@ services:
|
||||||
- 'coolify.managed=true'
|
- 'coolify.managed=true'
|
||||||
- 'coolify.type=database'
|
- 'coolify.type=database'
|
||||||
|
|
||||||
# Database backup service (optional, can be enabled in production)
|
|
||||||
backup:
|
backup:
|
||||||
build:
|
build:
|
||||||
context: .
|
context: .
|
||||||
|
|
@ -108,12 +103,10 @@ services:
|
||||||
PGPASSWORD: ${POSTGRES_PASSWORD}
|
PGPASSWORD: ${POSTGRES_PASSWORD}
|
||||||
BACKUP_DIR: /backups
|
BACKUP_DIR: /backups
|
||||||
RETENTION_DAYS: ${BACKUP_RETENTION_DAYS:-14}
|
RETENTION_DAYS: ${BACKUP_RETENTION_DAYS:-14}
|
||||||
# Optional S3 upload
|
|
||||||
S3_ENDPOINT: ${S3_ENDPOINT:-}
|
S3_ENDPOINT: ${S3_ENDPOINT:-}
|
||||||
S3_BUCKET: ${S3_BUCKET:-}
|
S3_BUCKET: ${S3_BUCKET:-}
|
||||||
AWS_ACCESS_KEY_ID: ${AWS_ACCESS_KEY_ID:-}
|
AWS_ACCESS_KEY_ID: ${AWS_ACCESS_KEY_ID:-}
|
||||||
AWS_SECRET_ACCESS_KEY: ${AWS_SECRET_ACCESS_KEY:-}
|
AWS_SECRET_ACCESS_KEY: ${AWS_SECRET_ACCESS_KEY:-}
|
||||||
# Optional GPG encryption
|
|
||||||
GPG_RECIPIENT_KEY: ${GPG_RECIPIENT_KEY:-}
|
GPG_RECIPIENT_KEY: ${GPG_RECIPIENT_KEY:-}
|
||||||
volumes:
|
volumes:
|
||||||
- backup_data:/backups
|
- backup_data:/backups
|
||||||
|
|
@ -126,7 +119,6 @@ services:
|
||||||
labels:
|
labels:
|
||||||
- 'coolify.managed=true'
|
- 'coolify.managed=true'
|
||||||
- 'coolify.type=service'
|
- 'coolify.type=service'
|
||||||
# Ofelia cron labels for scheduled backups
|
|
||||||
- 'ofelia.enabled=true'
|
- 'ofelia.enabled=true'
|
||||||
- 'ofelia.job-exec.backup-daily.schedule=0 0 3 * * *'
|
- 'ofelia.job-exec.backup-daily.schedule=0 0 3 * * *'
|
||||||
- 'ofelia.job-exec.backup-daily.command=/usr/local/bin/backup.sh'
|
- 'ofelia.job-exec.backup-daily.command=/usr/local/bin/backup.sh'
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue