Skip to content

Docker Network with Nginx Proxy Manager #2854

@EyyupA

Description

@EyyupA

Discussed in #2852

Originally posted by EyyupA April 23, 2023
I used this docker compose file:

version: '3.8'
services:
  app:
    image: 'jc21/nginx-proxy-manager:2.9.18'
    restart: unless-stopped
    ports:
      # These ports are in format <host-port>:<container-port>
      - '80:80' # Public HTTP Port
      - '443:443' # Public HTTPS Port
      #- '81:81' # Admin Web Port
      # Add any other Stream port you want to expose
      # - '21:21' # FTP
    environment:
      # Mysql/Maria connection parameters:
      DB_MARIADB_HOST: "db"
      DB_MARIADB_PORT: 3306
      DB_MARIADB_USER: "npm"
      DB_MARIADB_PASSWORD: "npm"
      DB_MARIADB_NAME: "npm"
      # Uncomment this if IPv6 is not enabled on your host
      # DISABLE_IPV6: 'true'
    volumes:
      - ./data:/data
      - ./letsencrypt:/etc/letsencrypt
    networks:
      default:
    depends_on:
      - db

  db:
    image: 'webhippie/mariadb:latest'
    restart: unless-stopped
    environment:
      MARIADB_ROOT_PASSWORD: 'npm'
      MARIADB_DATABASE: 'npm'
      MARIADB_USER: 'npm'
      MARIADB_PASSWORD: 'npm'
    volumes:
      - ./mysql:/var/lib/mysql
    networks:
      default:

networks:
  default:
    attachable: true
    driver: bridge
    ipam:
      driver: default
      config:
        - subnet: 10.51.0.0/16
          gateway: 10.51.0.1

If I add a container to this network (for example checkmk) i got a bad gateway.
For checkmk port 5000 is used.
But if i use a service which run on port 80 is works fine.

And i recognized also if i use the portainer network it work also with checkmk.

Screenshot from the nginx network which will be created with the compose file
image

Screenshort from the portainer network (with this is works but why?)
image

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions