diff --git a/docker-compose-services/portainer/README.md b/docker-compose-services/portainer/README.md index 5b0f09e6..f7ec2227 100644 --- a/docker-compose-services/portainer/README.md +++ b/docker-compose-services/portainer/README.md @@ -23,26 +23,39 @@ Portainer is a visual mode for management of containers and networks. Is open-so ## Connection -Ok, by default you can access to the Portainer interface at the next address from your browser: +Ok, by default you can access to the Portainer interface at the next addresses from your browser: ``` -https://projectname.ddev.site:9000 -https://127.0.0.1:9000 +# using http +http://projectname.ddev.site:9001 +http://127.0.0.1:9001 + +# or using https +https://projectname.ddev.site:8001 +https://127.0.0.1:8001 +``` +**Why?** Well, we're setting the mapped ports from Host to Guest just likes this: + +``` +environment: + HTTP_EXPOSE: "9001:9000" + HTTPS_EXPOSE: "8001:9000" ``` -Cause is the annotated port registered in the config.yaml file. If you want to avoid conflicts, just stop your DDEV-Local network, change the value and relaunch the containers. +If you want to avoid conflicts in the host side, just stop your DDEV-Local network, changing the value in the former section and relaunch the containers. -Just do: +Just do: ``` -ddev stop -vim docker-compose.portainer.yaml -ports: - - '3434:9000' -:wq! -ddev start +$ ddev stop +$ vim docker-compose.portainer.yaml + environment: + HTTP_EXPOSE: "3401:9000" + HTTPS_EXPOSE: "3501:9000" + :wq! +$ ddev start ``` -But remember that Portainer always exposes from port 9000, so use this address as destiny in your mapping. +And remember that Portainer always exposes internally to the ddev network from its port 9000 in the container, so use this address as destiny in your mapping. **Contributed by [davidjguru](https://gitlab.com/davidjguru)**, [Drupal Developer](https://www.drupal.org/u/davidjguru) and blogger in [The Russian Lullaby](https://www.therussianlullaby.com/). diff --git a/docker-compose-services/portainer/docker-compose.portainer.yaml b/docker-compose-services/portainer/docker-compose.portainer.yaml index abef3383..b2b721e0 100644 --- a/docker-compose-services/portainer/docker-compose.portainer.yaml +++ b/docker-compose-services/portainer/docker-compose.portainer.yaml @@ -1,23 +1,26 @@ --- version: '3.6' services: - portainer: - image: portainer/portainer:latest - restart: always - container_name: ddev-${DDEV_SITENAME}-portainer - labels: - com.ddev.site-name: ${DDEV_SITENAME} - com.ddev.approot: $DDEV_APPROOT - volumes: - - /var/run/docker.sock:/var/run/docker.sock - - portainer_data:/data - external_links: - - "ddev-router:${DDEV_HOSTNAME}" - cap_add: - - SYS_ADMIN - ports: - - '9000:9000' - - '8000:8000' + portainer: + image: portainer/portainer:latest + expose: + - "9000" + environment: + - VIRTUAL_HOST=$DDEV_HOSTNAME + - HTTP_EXPOSE=9001:9000 + - HTTPS_EXPOSE=8001:9000 + restart: "no" + container_name: ddev-${DDEV_SITENAME}-portainer + labels: + com.ddev.site-name: ${DDEV_SITENAME} + com.ddev.approot: $DDEV_APPROOT + volumes: + - /var/run/docker.sock:/var/run/docker.sock + - portainer_data:/data + external_links: + - "ddev-router:${DDEV_HOSTNAME}" + cap_add: + - SYS_ADMIN volumes: portainer_data: @@ -25,4 +28,3 @@ networks: default: external: name: ddev_default -