我有码头工人撰写。它有容器。
version: '3'
networks:
web:
external: true
services:
grader-v2-storage:
env_file:
- test.env
image: "84.201.149.110:443/grader-v2-storage:1.21.1speed"
restart: always
networks:
- web
labels:
- "traefik.enable=true"
- "traefik.backend=grader-v2-storage"
- "traefik.port=52052"
- "traefik.docker.network=web"
grader-v2-auth-service:
env_file:
- test.env
image: "84.201.149.110:443/grader-v2-auth-service:1.1.1"
restart: always
networks:
- web
labels:
- "traefik.enable=true"
- "traefik.backend=grader-v2-auth-service"
- "traefik.frontend.rule=Host:a.fless.pro"
- "traefik.port=61295"
- "traefik.docker.network=web"
traefik:
image: traefik:1.7.24
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
- ./traefik/traefik.toml:/etc/traefik/traefik.toml:ro
- ./traefik/acme:/etc/traefik/acme
networks:
- web
ports:
- "80:80"
- "443:443"
- "8080:8080"
在 docker 网络中,我通过它们的容器名称来引用它们。如果未设置域,如何从 Internet 访问它们?
要解决此问题,您应该映射应该突出的端口:
编写示例: