markdown 使用域访问portainer(在我们的例子中是portainer.test.dev)

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了markdown 使用域访问portainer(在我们的例子中是portainer.test.dev)相关的知识,希望对你有一定的参考价值。

```
reverseProxyPortainer
├── portainer
│   └── docker-compose.yml
└── reverseProxy
    ├── docker-compose.yml
    └── vhost.d
        └── portainer.test.dev
```    
        
1.  docker network create --driver=bridge reverseproxy_default
2.  cd reverseProxyPortainer/reverseProxy
3.  docker-compose up
4.  cd ../portainer
5.  docker-compose up
6. open /etc/hosts and add 
    127.0.0.1 portainer.test.dev
7. open your browser and go to http://portainer.test.dev and portainer UI will show




**reverseProxyPortainer/reverseProxy/docker-compose.yml**
```
version: "2"
services:
  nginx-proxy:
    image: jwilder/nginx-proxy
    container_name: reverseproxy
    restart: always
    ports:
      - "80:80"
    volumes:
      - "/var/run/docker.sock:/tmp/docker.sock:ro"
      - "./vhost.d:/etc/nginx/vhost.d:ro"
networks:
  default:
    external:
      name: reverseproxy_default
``` 




**reverseProxyPortainer/reverseProxy/vhost.d/portainer.test.dev**
```
proxy_http_version 1.1;
proxy_set_header Connection "";
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
```




**reverseProxyPortainer/portainer/docker-compose.yml**
```
version: '2'
services:
  portainer:
    image: portainer/portainer
    container_name: Portainer
    restart: always
    expose:
      - 9000
    ports:
      - 9000:9000
    volumes:
      - "/var/run/docker.sock:/var/run/docker.sock"
    environment:
      - VIRTUAL_HOST=portainer.test.dev
      - VIRTUAL_NETWORK=reverseproxy_default

networks:
  default:
    external:
      name: reverseproxy_default
```

以上是关于markdown 使用域访问portainer(在我们的例子中是portainer.test.dev)的主要内容,如果未能解决你的问题,请参考以下文章

Portainer实用教程

markdown 如何提供对本地作用域静态变量的全局访问。

Portainer 安装MySQL并开启远程访问

Portainer.io可视化工具使用

Portainer.io可视化工具使用

Docker Review - 图形化工具 Portainer