gravitl / netmaker

Netmaker makes networks with WireGuard. Netmaker automates fast, secure, and distributed virtual networks.
https://netmaker.io
Other
9.4k stars 547 forks source link

Changing Netmaker-UI port from 80 throws Netmaker Container into reboot loop #131

Closed MikePadge closed 3 years ago

MikePadge commented 3 years ago
version: "3.3"

services:
  mongodb:
    image: mongo:4.2
    ports:
      - "27017:27017"
    container_name: mongodb
    volumes:
      - mongovol:/data/db
    restart: always
    environment:
      MONGO_INITDB_ROOT_USERNAME: mongoadmin
      MONGO_INITDB_ROOT_PASSWORD: mongopass
  netmaker:
    container_name: netmaker
    depends_on:
      - mongodb
    image: gravitl/netmaker:v0.2
    ports:
      - "8081:8081"
      - "50051:50051"
    environment:
      MONGO_HOST: mongodb
    restart: always
  netmaker-ui:
    container_name: netmaker-ui
    depends_on:
      - netmaker
    image: gravitl/netmaker-ui:v0.2
    ports:
      - "8088:80"
    environment:
      BACKEND_URL: "http://x.x.x.x:8081"
volumes:
  mongovol: {}

The bind port on the host for Netmaker-UI is the only thing I changed, but somehow this causes the netmaker container itself to get stuck in a reboot loop?

MikePadge commented 3 years ago
version: "3.3"

services:
  mongodb:
    image: mongo:4.2
    ports:
      - "27017:27017"
    container_name: mongodb
    volumes:
      - mongovol:/data/db
    restart: always
    environment:
      MONGO_INITDB_ROOT_USERNAME: mongoadmin
      MONGO_INITDB_ROOT_PASSWORD: mongopass
#  netmaker:
#    container_name: netmaker
#    depends_on:
#      - mongodb
#    image: gravitl/netmaker:v0.2
#    ports:
#      - "8081:8081"
#      - "50051:50051"
#    environment:
#      MONGO_HOST: mongodb
#    restart: always
  netmaker-ui:
    container_name: netmaker-ui
#    depends_on:
#      - netmaker
    image: gravitl/netmaker-ui:v0.2
    ports:
      - "8088:80"
    environment:
      BACKEND_URL: "x.x.x.x:8081"
volumes:
  mongovol: {}

I started the netmaker container image by itself via docker run -dit -e "MONGO_HOST=mongodb" -p 50051:50051 -p 8081:8081 netmaker

Then docker network connect netmaker_default <containerid>

Refreshing the UI in any manner kills the netmaker container.

MikePadge commented 3 years ago

Backend_URL in the Docker-Compose requires http:// preceding the IP address and port designation

Adding servers after the fact via the cli command needs this http:// removed.

Also if you're a dumb dumb like me and think the MONGO_INITDB_ROOT_USERNAME: mongoadmin MONGO_INITDB_ROOT_PASSWORD: mongopass

Env vars are for initializing the database credentials, you would be incorrect. I changed these from the default, and what happens is netmaker launches like it already has a user created.