Docker 安装导航WebStack导航
github地址
https://github.com/WebStackPage/WebStackPage.github.io
一、采用容器化部署
二、使用docker-compose部署
#docker-compose.yaml
version: '3'
services:
db:
image: mysql:5.7
restart: always
container_name: "navi_mysql"
environment:
MYSQL_ROOT_PASSWORD: Hwkj_123456
MYSQL_DATABASE: webstack
MYSQL_USER: webstack
MYSQL_PASSWORD: 123456
command: --default-authentication-plugin=mysql_native_password
networks:
- "webstacknet"
volumes:
- /opt/navi/mysql/data:/var/lib/mysql
redis:
image: redis:3
container_name: "navi_redis"
restart: always
networks:
- "webstacknet"
webstack:
image: arvon2014/webstack-laravel:v1.2.1
container_name: "navi_webstack"
ports:
- 8000:8000
depends_on:
- "db"
- "redis"
environment:
LOGIN_COPTCHA: "false"
DB_HOST: db
DB_PORT: 3306
DB_DATABASE: webstack
DB_USERNAME: webstack
DB_PASSWORD: 123456
command: ['/entrypoint.sh','serve']
networks:
- "webstacknet"
#volumes:
#- /opt/navi/navi/:/opt/navi/
networks:
webstacknet:
driver: bridge
docker-compose up -d
三、把web容器里的文件拷贝到宿主机目录,然后再挂载印射
docker cp xxxx:/opt/navi /opt/navi/
四、停掉容器并删除掉
docker-compose down
五、重新编辑docker-compose.yaml,把web容器的vlume给绑定起
#docker-compose.yaml
version: '3'
services:
db:
image: mysql:5.7
restart: always
container_name: "navi_mysql"
environment:
MYSQL_ROOT_PASSWORD: Hwkj_123456
MYSQL_DATABASE: webstack
MYSQL_USER: webstack
MYSQL_PASSWORD: 123456
command: --default-authentication-plugin=mysql_native_password
networks:
- "webstacknet"
volumes:
- /opt/navi/mysql/data:/var/lib/mysql
redis:
image: redis:3
container_name: "navi_redis"
restart: always
networks:
- "webstacknet"
webstack:
image: arvon2014/webstack-laravel:v1.2.1
container_name: "navi_webstack"
ports:
- 8000:8000
depends_on:
- "db"
- "redis"
environment:
LOGIN_COPTCHA: "false"
DB_HOST: db
DB_PORT: 3306
DB_DATABASE: webstack
DB_USERNAME: webstack
DB_PASSWORD: 123456
command: ['/entrypoint.sh','new-server']
networks:
- "webstacknet"
volumes:
- /opt/navi/navi/:/opt/navi/
networks:
webstacknet:
driver: bridge
六、后台地址
http://192.168.48.144:8000/admin
本文来自博客园,作者:弩哥++,转载请注明原文链接:https://www.cnblogs.com/bangbangzoutianya/p/17203556.html