|
@@ -24,20 +24,24 @@ services:
|
|
|
environment:
|
|
|
MYSQL_DATABASE: ${DB_NAME}
|
|
|
MYSQL_ROOT_PASSWORD: ${DB_PASSWORD}
|
|
|
+ networks:
|
|
|
+ - app-network
|
|
|
|
|
|
redis:
|
|
|
image: redis:5.0
|
|
|
ports:
|
|
|
- "6379:6379"
|
|
|
restart: always
|
|
|
+ networks:
|
|
|
+ - app-network
|
|
|
|
|
|
- zyc-server:
|
|
|
- container_name: zyc-server
|
|
|
+ backend:
|
|
|
+ container_name: backend
|
|
|
build:
|
|
|
context: .
|
|
|
- dockerfile: zyc-dockerfile
|
|
|
+ dockerfile: backend-dockerfile
|
|
|
ports:
|
|
|
- - "80:80"
|
|
|
+ - "8081:8080"
|
|
|
volumes:
|
|
|
- ./zyc/logs:/home/zyc/logs
|
|
|
- ./zyc/uploadPath:/home/zyc/uploadPath
|
|
@@ -54,4 +58,21 @@ services:
|
|
|
REDIS_HOST: ${REDIS_HOST}
|
|
|
REDIS_PORT: ${REDIS_PORT}
|
|
|
REDIS_PASSWORD: ${REDIS_PASSWORD}
|
|
|
- REDIS_DATABASE: ${REDIS_DATABASE}
|
|
|
+ REDIS_DATABASE: ${REDIS_DATABASE}
|
|
|
+ networks:
|
|
|
+ - app-network
|
|
|
+
|
|
|
+ frontend:
|
|
|
+ image: frontend # 前端镜像名称
|
|
|
+ container_name: frontend
|
|
|
+ build:
|
|
|
+ context: .
|
|
|
+ dockerfile: frontend-dockerfile
|
|
|
+ ports:
|
|
|
+ - "80:80" # 映射前端服务端口
|
|
|
+ networks:
|
|
|
+ - app-network
|
|
|
+
|
|
|
+networks:
|
|
|
+ app-network:
|
|
|
+ driver: bridge
|