本地docker部署问题 #114
本地docker部署问题
#114
-
使用docker compose部署,我要反代的话,请问env中的PORT 是容器内的还是宿主机的? 另外在 docker-compose.yml中,修改为 是否正确? 现在部署没有报错,但是web和机器人均无法使用。 经过尝试只有在env中host设为0.0.0.0,port为80时,直接用IP访问会有404的提示。其他情况均完全无法访问。 |
Beta Was this translation helpful? Give feedback.
Answered by
y-young
Mar 20, 2025
Replies: 1 comment
-
|
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
wolfling45
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
.env
中的 PORT 是 server 在容器中监听的端口,docker-compose.yml 中的 PORT 是主机端口:容器端口
,因此.env
中的端口应和容器端口一致(保留默认 80即可),在容器外通过主机端口访问。