代码拉取完成,页面将自动刷新
version: "3.3"
services:
traefik:
image: "traefik:v2.10"
networks:
- fars-net
command:
# 是否启动WEB UI
- --api.dashboard=true
- --providers.docker=true
- --providers.docker.exposedByDefault=false
- --providers.docker.constraints=Label(`traefik.constraint-label`, `fars-docker`)
- --entrypoints.web.address=:80
ports:
# 服务端口
- "80:80"
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
labels:
- traefik.enable=true
- traefik.constraint-label=fars-docker
# 配置traefik api@internal
- traefik.http.routers.api.rule=Host(`traefik.zodiac.com`) && PathPrefix(`/api`)
- traefik.http.routers.api.service=api@internal
- traefik.http.routers.api.middlewares=auth
# 配置traefik dashboard@internal
- traefik.http.routers.dashboard.rule=Host(`traefik.zodiac.com`)
- traefik.http.routers.dashboard.service=dashboard@internal
- traefik.http.routers.dashboard.middlewares=auth
# 配置安全认证
- traefik.http.middlewares.auth.basicauth.users=test:$$apr1$$H6uskkkW$$IgXLP6ewTrSuBkTrqE8wj/,test2:$$apr1$$d9hr9HBB$$4HxwgUir3HP4EsggP/QNo0
db:
image: postgres:12
networks:
- fars-net
ports:
# 服务端口
- "5432:5432"
volumes:
- app-db-data:/var/lib/postgresql/data/pgdata
env_file:
- .env
environment:
- PGDATA=/var/lib/postgresql/data/pgdata
deploy:
placement:
constraints:
- node.labels.fars-docker.app-db-data == true
pgadmin:
image: dpage/pgadmin4
networks:
- fars-net
depends_on:
- db
env_file:
- .env
labels:
- traefik.enable=true
- traefik.docker.network=fars-net
- traefik.constraint-label=fars-docker
- traefik.http.routers.fars-docker-pgadmin.entrypoints=web
- traefik.http.routers.fars-docker-pgadmin-http.rule=Host(`pgadmin.zodiac.com`)
- traefik.http.services.fars-docker-pgadmin.loadbalancer.server.port=5050
volumes:
app-db-data:
networks:
fars-net:
# Allow setting it to false for testing
external: false
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。