在 ubuntu 22.04 中为 docker 容器映射 .local 域和子域

在 ubuntu 22.04 中为 docker 容器映射 .local 域和子域

我有一台安装有 Ubuntu 2022 的 Linux 服务器,其 IP 为 192.168.100.82,要访问运行在 Docker 上的应用程序,需要输入 IP 地址和端口,端口 3000、5001、8080 上分别有三个应用程序(Gitea、Documize 和 Jira)我的服务器位于内部数据中心,信息如下:

$sudo hostname -I
192.168.100.82 172.18.0.1 172.17.0.1 150.50.50.1

150.50.50.1 是我的 docker 网络。

$hostname
nitro-web

.....

$ cat /etc/hosts

127.0.0.1 localhost
127.0.1.1 nitro-web
### The following lines are desirable for IPv6 capable hosts
::1     ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
所以,我还没有在我的 VPS 中安装 NGINX,因为我不了解 docker 容器应用程序的 nginx 配置。

最后我想为容器映射这个域:

192.168.100.82:8080 ----> jira.nitro.local
192.168.100.82:3000 ----> git.nitro.local
192.168.100.82:5001 ----> doc.nitro.local

问候。

相关内容