宝塔面板配置教程 #83
yaowangmx
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
问题描述
1、宝塔面板-点击Docker菜单会自动安装Docker
2、Docker页面中,点击“本地镜像”tab,点击按钮:“从仓库拉取”,在弹窗中选择“命令拉取”,在输入框中输入命令:
docker pull imsyy/dailyhot-api:latest
点击按钮“执行命令”,过一会刷新页面可以看到列表里面已经拉取到了对应的镜像
3、Docker页面中,点击“容器”tab,点击“创建容器”,在弹窗点击命令创建,输入命令:
docker run -p 6688:6688 -d imsyy/dailyhot-api:latest
点击执行命令,刷新页面可以看到容器创建成功
4、宝塔面板-点击“网站”菜单,选择PHP,添加站点,输入域名,根目录选择新建一个空白的文件夹,点击确定,生成网站
5、点击刚刚新建的站点,点击设置,在弹窗中点击配置文件,将location修改如下
location / { proxy_pass http://127.0.0.1:6688; # 指向 Docker 容器 proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; }
6、根据需要当前ssl证书,访问域名就可以看到项目配置成功
补充信息
No response
Beta Was this translation helpful? Give feedback.
All reactions