完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
1、拉取镜像
docker pull mongo:3.4docker pull redis:4.0.6docker pull easymock/easymock:1.6.0 docker pull nginx |
|
相关推荐
1个回答
|
|
2、建立本地网路
# 创建bridge网络:docker network create local_net 3、建立文件夹 /app/mongo/app/nginx/webwork /app/nginx/config/conf.d /app/nginx/log/app/nginx/app/redis 4、上传easy-mock文件 production.json { "port": 7300, "host": "0.0.0.0", "pageSize": 30, "proxy": false, "db": "mongodb://local_mongo:27017/easy-mock", "unsplashClientId": "", "redis": { "keyPrefix": "[Easy Mock]", "port": 6379, "host": "local_redis", "password": "", "db": 0 }, "blackList": { "projects": [], "ips": [] }, "rateLimit": { "max": 1000, "duration": 1000 }, "jwt": { "expire": "14 days", "secret": "shared-secret" }, "upload": { "types": [".jpg", ".jpeg", ".png", ".gif", ".json", ".yml", ".yaml"], "size": 5242880, "dir": "../public/upload", "expire": { "types": [".json", ".yml", ".yaml"], "day": -1 } }, "ldap": { "server": "", "bindDN": "", "password": "", "filter": { "base": "", "attributeName": "" } }, "fe": { "copyright": "", "storageNamespace": "easy-mock_", "timeout": 25000, "publicPath": "/dist/" } } 5、创建容器 # nginxdocker run -tid -p 80:80 / --name nginx --network local_net --network-alias local_nginx / -v /app/nginx/webwork:/usr/share/nginx/html / -v /app/nginx/config/conf.d:/etc/nginx/conf.d / -v /app/nginx/log:/var/log/nginx / nginx# mongo docker run -itd -p 27017:27017 /--name app_mongo --network local_net --network-alias local_mongo /-v /app/mongo:/data/db /mongo:3.4# redisdocker run -tid -p 6379:6379 / --name app_redis --network local_net --network-alias local_redis / -v /app/redis:/data / --privileged=true / redis:4.0.6 redis-server / --appendonly yes# easy-mockdocker run -tid -p 7300:7300 / --name app_mock --network local_net --network-alias local_mock / -v /app/easy-mock/logs:/home/easy-mock/easy-mock/logs / -v /app/easy-mock/production.json:/home/easy-mock/easy-mock/config/production.json / easymock/easymock:1.6.0 / /bin/bash -c "npm start" 6、配置nginx,新建配置文件 /app/nginx/config/conf.d/easymock.conf server { listen 80; server_name xxxx.com; # 监听的域名 location / { proxy_pass http://local_mock:7300; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Host $http_host; proxy_set_header X-Forwarded-Proto $scheme; proxy_buffering off; }} 7、进入 nginx 容器,重新家在配置文件 # 然后进入容器,重新加载nginxdocker exec -it nginx bash# 修改配置重新加载nginx -s reload |
|
|
|
你正在撰写答案
如果你是对答案或其他答案精选点评或询问,请使用“评论”功能。
“0元购”智元灵犀X1机器人,软硬件全套图纸和代码全公开!资料免费下载!
1088 浏览 1 评论
956 浏览 0 评论
【实操文档】在智能硬件的大模型语音交互流程中接入RAG知识库
5770 浏览 1 评论
防止AI大模型被黑客病毒入侵控制(原创)聆思大模型AI开发套件评测4
988 浏览 0 评论
不可错过!人工神经网络算法、PID算法、Python人工智能学习等资料包分享(附源代码)
3278 浏览 0 评论
浏览过的版块 |
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-11-22 02:13 , Processed in 0.491860 second(s), Total 71, Slave 54 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号