You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I used the GitHub search to find a similar question and didn't find it.
I searched in the documentation/README.
I already searched in Google "How to do X" and didn't find any information.
I already read and followed all the tutorial in the docs/README and didn't find an answer.
Commit to Help
I commit to help with one of those options 👆
Example Code
docker-compose file is default and i added one more service with different domain in labels
services:
db:
image: postgres:12restart: alwaysvolumes:
- app-db-data:/var/lib/postgresql/data/pgdataenv_file:
- .envenvironment:
- PGDATA=/var/lib/postgresql/data/pgdata
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD?Variable not set}
- POSTGRES_USER=${POSTGRES_USER?Variable not set}
- POSTGRES_DB=${POSTGRES_DB?Variable not set}adminer:
image: adminerrestart: alwaysnetworks:
- traefik-public
- defaultdepends_on:
- dbenvironment:
- ADMINER_DESIGN=pepa-linha-darklabels:
- traefik.enable=true
- traefik.docker.network=traefik-public
- traefik.constraint-label=traefik-public
- traefik.http.routers.${STACK_NAME?Variable not set}-adminer-http.rule=Host(`adminer.${DOMAIN?Variable not set}`)
- traefik.http.routers.${STACK_NAME?Variable not set}-adminer-http.entrypoints=http
- traefik.http.routers.${STACK_NAME?Variable not set}-adminer-http.middlewares=https-redirect
- traefik.http.routers.${STACK_NAME?Variable not set}-adminer-https.rule=Host(`adminer.${DOMAIN?Variable not set}`)
- traefik.http.routers.${STACK_NAME?Variable not set}-adminer-https.entrypoints=https
- traefik.http.routers.${STACK_NAME?Variable not set}-adminer-https.tls=true
- traefik.http.routers.${STACK_NAME?Variable not set}-adminer-https.tls.certresolver=le
- traefik.http.services.${STACK_NAME?Variable not set}-adminer.loadbalancer.server.port=8080backend:
image: '${DOCKER_IMAGE_BACKEND?Variable not set}:${TAG-latest}'restart: alwaysnetworks:
- traefik-public
- defaultdepends_on:
- dbenv_file:
- .envenvironment:
- DOMAIN=${DOMAIN}
- ENVIRONMENT=${ENVIRONMENT}
- BACKEND_CORS_ORIGINS=${BACKEND_CORS_ORIGINS}
- SECRET_KEY=${SECRET_KEY?Variable not set}
- FIRST_SUPERUSER=${FIRST_SUPERUSER?Variable not set}
- FIRST_SUPERUSER_PASSWORD=${FIRST_SUPERUSER_PASSWORD?Variable not set}
- USERS_OPEN_REGISTRATION=${USERS_OPEN_REGISTRATION}
- SMTP_HOST=${SMTP_HOST}
- SMTP_USER=${SMTP_USER}
- SMTP_PASSWORD=${SMTP_PASSWORD}
- EMAILS_FROM_EMAIL=${EMAILS_FROM_EMAIL}
- POSTGRES_SERVER=db
- POSTGRES_PORT=${POSTGRES_PORT}
- POSTGRES_DB=${POSTGRES_DB}
- POSTGRES_USER=${POSTGRES_USER?Variable not set}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD?Variable not set}
- SENTRY_DSN=${SENTRY_DSN}build:
context: ./backendargs:
INSTALL_DEV: ${INSTALL_DEV-false}platform: linux/amd64 # Patch for M1 Maclabels:
- traefik.enable=true
- traefik.docker.network=traefik-public
- traefik.constraint-label=traefik-public
- traefik.http.services.${STACK_NAME?Variable not set}-backend.loadbalancer.server.port=80
- traefik.http.routers.${STACK_NAME?Variable not set}-backend-http.rule=(Host(`${DOMAIN?Variable not set}`) || Host(`www.${DOMAIN?Variable not set}`)) && (PathPrefix(`/api`) || PathPrefix(`/docs`) || PathPrefix(`/redoc`))
- traefik.http.routers.${STACK_NAME?Variable not set}-backend-http.entrypoints=http
- traefik.http.routers.${STACK_NAME?Variable not set}-backend-https.rule=(Host(`${DOMAIN?Variable not set}`) || Host(`www.${DOMAIN?Variable not set}`)) && (PathPrefix(`/api`) || PathPrefix(`/docs`) || PathPrefix(`/redoc`))
- traefik.http.routers.${STACK_NAME?Variable not set}-backend-https.entrypoints=https
- traefik.http.routers.${STACK_NAME?Variable not set}-backend-https.tls=true
- traefik.http.routers.${STACK_NAME?Variable not set}-backend-https.tls.certresolver=le# Define Traefik Middleware to handle domain with and without "www" to redirect to only one
- traefik.http.middlewares.${STACK_NAME?Variable not set}-www-redirect.redirectregex.regex=^http(s)?://www.(${DOMAIN?Variable not set})/(.*)# Redirect a domain with www to non-www
- traefik.http.middlewares.${STACK_NAME?Variable not set}-www-redirect.redirectregex.replacement=http$${1}://${DOMAIN?Variable not set}/$${3}# Enable www redirection for HTTP and HTTPS
- traefik.http.routers.${STACK_NAME?Variable not set}-backend-http.middlewares=https-redirect,${STACK_NAME?Variable not set}-www-redirect
- traefik.http.routers.${STACK_NAME?Variable not set}-backend-https.middlewares=${STACK_NAME?Variable not set}-www-redirectfrontend:
image: '${DOCKER_IMAGE_FRONTEND?Variable not set}:${TAG-latest}'restart: alwaysnetworks:
- traefik-public
- defaultbuild:
context: ./frontendargs:
- VITE_API_URL=https://${DOMAIN?Variable not set}
- NODE_ENV=productionlabels:
- traefik.enable=true
- traefik.docker.network=traefik-public
- traefik.constraint-label=traefik-public
- traefik.http.services.${STACK_NAME?Variable not set}-frontend.loadbalancer.server.port=80
- traefik.http.routers.${STACK_NAME?Variable not set}-frontend-http.rule=Host(`${DOMAIN?Variable not set}`) || Host(`www.${DOMAIN?Variable not set}`)
- traefik.http.routers.${STACK_NAME?Variable not set}-frontend-http.entrypoints=http
- traefik.http.routers.${STACK_NAME?Variable not set}-frontend-https.rule=Host(`${DOMAIN?Variable not set}`) || Host(`www.${DOMAIN?Variable not set}`)
- traefik.http.routers.${STACK_NAME?Variable not set}-frontend-https.entrypoints=https
- traefik.http.routers.${STACK_NAME?Variable not set}-frontend-https.tls=true
- traefik.http.routers.${STACK_NAME?Variable not set}-frontend-https.tls.certresolver=le# Enable www redirection for HTTP and HTTPS
- traefik.http.routers.${STACK_NAME?Variable not set}-frontend-https.middlewares=${STACK_NAME?Variable not set}-www-redirect
- traefik.http.routers.${STACK_NAME?Variable not set}-frontend-http.middlewares=https-redirect,${STACK_NAME?Variable not set}-www-redirectlink_shortner:
build:
context: ./link-shortnerenvironment:
- DOMAIN=${DOMAIN_LINK_SHORTNER}
- ENVIRONMENT=${ENVIRONMENT}
- CORS_ORIGINS=${LINK_SHORTNER_CORS_ORIGINS}
- SECRET_KEY=${SECRET_KEY?Variable not set}
- FIRST_SUPERUSER=${FIRST_SUPERUSER?Variable not set}
- FIRST_SUPERUSER_PASSWORD=${FIRST_SUPERUSER_PASSWORD?Variable not set}
- USERS_OPEN_REGISTRATION=${USERS_OPEN_REGISTRATION}
- SMTP_HOST=${SMTP_HOST}
- SMTP_USER=${SMTP_USER}
- SMTP_PASSWORD=${SMTP_PASSWORD}
- EMAILS_FROM_EMAIL=${EMAILS_FROM_EMAIL}
- POSTGRES_SERVER=db
- POSTGRES_PORT=${POSTGRES_PORT}
- POSTGRES_DB=${POSTGRES_DB}
- POSTGRES_USER=${POSTGRES_USER?Variable not set}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD?Variable not set}
- SENTRY_DSN=${SENTRY_DSN}depends_on:
- dblabels:
- traefik.enable=true
- traefik.docker.network=traefik-public
- traefik.constraint-label=traefik-public
- traefik.http.services.link_shortner.loadbalancer.server.port=9080
- traefik.http.routers.link_shortner-http.rule=Host(`${DOMAIN_LINK_SHORTNER}`)
- traefik.http.routers.link_shortner-http.entrypoints=http
- traefik.http.routers.link_shortner-https.rule=Host(`${DOMAIN_LINK_SHORTNER}`)
- traefik.http.routers.link_shortner-https.entrypoints=https
- traefik.http.routers.link_shortner-https.tls=true
- traefik.http.routers.link_shortner-https.tls.certresolver=lenetworks:
traefik-public:
# Allow setting it to false for testingexternal: truevolumes:
app-db-data:
Description
Gateway Timeout everywhere except traefic dashboard. All domains have certificates.
DNS as in documentation for both domains
xxx.yyy
*.xxx.yyy
root@afili-link:~/code/full-stack-fastapi-template# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
72a820b74909 full-stack-fastapi-template-link_shortner "bash ./start.sh" 4 minutes ago Up 4 minutes 9080/tcp full-stack-fastapi-template-link_shortner-1
8a246059cd7b backend:latest "/start-reload.sh" 4 minutes ago Up 4 minutes 80/tcp, 0.0.0.0:8888->8888/tcp, :::8888->8888/tcp full-stack-fastapi-template-backend-1
e2f37cd594c1 frontend:latest "/docker-entrypoint.…" 5 minutes ago Up 5 minutes 80/tcp full-stack-fastapi-template-frontend-1
aee02575a16d postgres:12 "docker-entrypoint.s…" About an hour ago Up About an hour 0.0.0.0:5432->5432/tcp, :::5432->5432/tcp full-stack-fastapi-template-db-1
e1c5a6e6b823 schickling/mailcatcher "sh -c 'mailcatcher …" About an hour ago Up About an hour 0.0.0.0:1025->1025/tcp, :::1025->1025/tcp, 0.0.0.0:1080->1080/tcp, :::1080->1080/tcp full-stack-fastapi-template-mailcatcher-1
e764f52421e4 traefik:3.0 "/entrypoint.sh --pr…" 2 hours ago Up 2 hours 0.0.0.0:80->80/tcp, :::80->80/tcp, 0.0.0.0:443->443/tcp, :::443->443/tcp traefik-public-traefik-1
traefik logs
Traefic dashboard
Operating System
Linux
Operating System Details
Ubuntu 24.04 LTS
Python Version
3.12.3
Additional Context
npm run build didn't work on the server it was sitting for 10 minutes, so i built it locally.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
First Check
Commit to Help
Example Code
docker-compose file is default and i added one more service with different domain in labels
Description
Gateway Timeout everywhere except traefic dashboard. All domains have certificates.
DNS as in documentation for both domains
traefik logs
Traefic dashboard
Operating System
Linux
Operating System Details
Ubuntu 24.04 LTS
Python Version
3.12.3
Additional Context
npm run build
didn't work on the server it was sitting for 10 minutes, so i built it locally.I will appretiate any hints on the issue.
Beta Was this translation helpful? Give feedback.
All reactions