我有一个auth
服务(node.js 后端,fastify),nextjs
服务于 SSR 反应应用程序和 traefik 作为前面的反向代理的服务。使用当前配置,应用程序可以正确提供,但我正在502 Bad Gateway
获取auth
.
// traefik.toml
[entryPoints]
[entryPoints.http]
address = ":80"
[api]
// traefik docker-compose
version: '3'
networks:
default:
external:
name: traefik_default
services:
reverse-proxy:
image: traefik
command: --docker
ports:
- "80:80"
- "8080:8080" # The Web UI (enabled by --api)
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- ./traefik.toml:/traefik.toml
// auth docker-compose
version: "3.7"
networks:
default:
external:
name: traefik_default
services:
auth:
build: .
labels:
- "traefik.frontends=auth"
- "traefik.frontend.rule=Host:auth.app.loc"
- "treafik.port=80"
- "traefik.backends=backend_auth"
volumes:
- .:/usr/src/app
- /usr/src/app/node_modules
ports:
- 5000
command: node .
// nextjs app docker-compose
version: "3.7"
networks:
default:
external:
name: traefik_default
services:
nextjs:
build: .
labels:
- "traefik.frontends=nextjs"
- "traefik.frontend.rule=Host:app.loc"
- "treafik.port=80"
- "traefik.backends=backend_nextjs"
volumes:
- .:/usr/src/app
- /usr/src/app/node_modules
ports:
- 3000
command: npm run dev