更新文档,优化docker-compose的网络自定义

This commit is contained in:
SliverHorn
2020-09-11 11:43:17 +08:00
parent ecfc8cd1e7
commit e3ccccd1f3
9 changed files with 803 additions and 887 deletions
+24 -7
View File
@@ -1,24 +1,32 @@
version: "3.8"
networks:
network:
ipam:
driver: default
config:
- subnet: '177.7.0.0/16'
services:
web:
build:
context: ./
dockerfile: ./Dockerfile
dockerfile: ./dockerfile_web
container_name: gva-web
restart: always
ports:
- '8000:8000'
links:
- server
depends_on:
- server
command: ['nginx-debug', '-g', 'daemon off;']
command: [ 'nginx-debug', '-g', 'daemon off;' ]
networks:
network:
ipv4_address: 177.7.0.11
server:
build:
context: ./
dockerfile: ./DockerfileServer
dockerfile: ./dockerfile_server
container_name: gva-server
restart: always
ports:
@@ -26,6 +34,9 @@ services:
depends_on:
- mysql
- redis
networks:
network:
ipv4_address: 177.7.0.12
mysql:
image: mysql:8.0.21
@@ -38,11 +49,17 @@ services:
MYSQL_DATABASE: 'qmPlus' # 初始化启动时要创建的数据库的名称
MYSQL_ROOT_PASSWORD: 'Aa@6447985' # root管理员用户密码
volumes:
- '.docker-compose/docker-entrypoint-initdb.d:/docker-entrypoint-initdb.d'
- '.docker-compose/docker-entrypoint-initdb.d:/docker-entrypoint-initdb.d'
networks:
network:
ipv4_address: 177.7.0.13
redis:
image: redis:6.0.6
container_name: gva-redis # 容器名
restart: always
ports:
- '6379:6379'
- '6379:6379'
networks:
network:
ipv4_address: 177.7.0.14