docker 部署nginx
1、拉取阿里的nginx镜像:
docker pull crpi-k5k93ldwfc7o75ip.cn-hangzhou.personal.cr.aliyuncs.com/list_su/nginx:stable-perl
2、官方nginx镜像:
docker pull nginx:stable-perl
3、创建挂载文件目录
mkdir nginx && cd nginx
mkdir conf
mkdir html
mkdir log
4、运行docker nginx,然后复制配置到挂载文件目录中
docker run -d crpi-k5k93ldwfc7o75ip.cn-hangzhou.personal.cr.aliyuncs.com/list_su/nginx:stable-perl
docker cp 4381c62617a8:/etc/nginx/nginx.conf /root/nginx/conf/nginx.conf
docker cp 4381c62617a8:/etc/nginx/conf.d /root/nginx/conf/conf.d
docker cp 4381c62617a8:/usr/share/nginx/html/ /root/nginx
5、停止nginx容器,删除nginx容器
docker stop 4381c62617a8
docker rm 4381c62617a8
6、启动nginx服务
docker run -d -p 8089:80 --name nginx --privileged --restart always -v /root/nginx/conf/nginx.conf:/etc/nginx/nginx.conf -v /root/nginx/conf/conf.d:/etc/nginx/conf.d -v /root/nginx/html:/usr/share/nginx/html -v /root/nginx/log:/var/log/nginx crpi-k5k93ldwfc7o75ip.cn-hangzhou.personal.cr.aliyuncs.com/list_su/nginx:stable-perl
7、测试 服务器ip:8089
8、添加项目,烟花JS
项目链接:GitCode - 全球开发者的开源社区,开源代码托管平台
git clone https://gitcode.com/gh_mirrors/fi/Firework_Simulator.git
重启docker
docker restart 4ad6437a7f2f
服务器ip:8089/Firework_Simulator/index.html
或修改nginx配置