refactor(docker): standardize docker network name to 'frontend'

- Replace 'traefik-network' with 'frontend' in docker-compose.traefik.yml
- Replace 'traefik-network' with 'frontend' in switch-to-traefik.sh
- Replace 'your-main-network' with 'frontend' in DOCKER_DEPLOYMENT.md examples
- Ensure consistency across Docker configuration and documentation

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
zly
2026-01-14 14:39:57 +08:00
parent 9835b6e341
commit 65ba1d938d
3 changed files with 10 additions and 11 deletions

View File

@@ -175,10 +175,10 @@ services:
- "traefik.http.routers.bttoxin-backend.entrypoints=websecure" - "traefik.http.routers.bttoxin-backend.entrypoints=websecure"
# ... 其他 label # ... 其他 label
networks: networks:
- your-main-network - frontend
networks: networks:
your-main-network: frontend:
external: true external: true
``` ```

View File

@@ -14,14 +14,14 @@ services:
volumes: volumes:
- postgres_data:/var/lib/postgresql/data - postgres_data:/var/lib/postgresql/data
networks: networks:
- traefik-network - frontend
redis: redis:
image: docker.m.daocloud.io/library/redis:7-alpine image: docker.m.daocloud.io/library/redis:7-alpine
container_name: bttoxin-redis container_name: bttoxin-redis
restart: unless-stopped restart: unless-stopped
networks: networks:
- traefik-network - frontend
bttoxin: bttoxin:
build: build:
@@ -42,10 +42,11 @@ services:
- postgres - postgres
- redis - redis
networks: networks:
- traefik-network - frontend
labels: labels:
# Enable Traefik for this container # Enable Traefik for this container
- "traefik.enable=true" - "traefik.enable=true"
- "traefik.docker.network=frontend"
# HTTP Router (redirect to HTTPS) # HTTP Router (redirect to HTTPS)
- "traefik.http.routers.bttoxin.rule=Host(`bttiaw.hzau.edu.cn`)" - "traefik.http.routers.bttoxin.rule=Host(`bttiaw.hzau.edu.cn`)"
@@ -65,10 +66,8 @@ services:
- "traefik.http.middlewares.redirect-to-https.redirectscheme.permanent=true" - "traefik.http.middlewares.redirect-to-https.redirectscheme.permanent=true"
networks: networks:
traefik-network: frontend:
external: true external: true
# Create this network first: docker network create traefik-network
# Or set external: false to let docker-compose create it
volumes: volumes:
postgres_data: postgres_data:
@@ -91,7 +90,7 @@ volumes:
# volumes: # volumes:
# - "/var/run/docker.sock:/var/run/docker.sock:ro" # - "/var/run/docker.sock:/var/run/docker.sock:ro"
# networks: # networks:
# - traefik-network # - frontend
# #
# networks: # networks:
# traefik-network: # frontend:

View File

@@ -7,7 +7,7 @@ docker compose -f /home/zly/project/bttoxin-pipeline/docker/compose/docker-compo
echo "Starting with Traefik..." echo "Starting with Traefik..."
docker run -d \ docker run -d \
--name bttoxin-pipeline \ --name bttoxin-pipeline \
--network traefik-network \ --network frontend \
-v /home/zly/project/bttoxin-pipeline/jobs:/app/jobs \ -v /home/zly/project/bttoxin-pipeline/jobs:/app/jobs \
-e JOBS_DIR=/app/jobs \ -e JOBS_DIR=/app/jobs \
--label traefik.enable=true \ --label traefik.enable=true \