sethforprivacy / simple-monerod-docker

A simple and straightforward Dockerized monerod built from source and exposing standard ports.
https://sethforprivacy.com/guides/run-a-monero-node/
MIT License
99 stars 18 forks source link

Exposing port 18081 #102

Closed arhue closed 9 months ago

arhue commented 9 months ago

Hi,

Thank you for the work you've put in this. I have an issue with exposing port 18081 so that I can use it to connect it to a dashboard.

This is my Docker Compose config.

version: '3.3'

services:
  monerod:
    image: sethsimmons/simple-monerod:latest
    user: 0:0
    volumes:
      - /mnt/vol1/monero/bitmonero:/home/monero/.bitmonero
    deploy:
      mode: replicated
      replicas: 1
    networks:
      - monero
    ports:
      - 18080:18080
      - 18089:18089
    expose:
      - "18080"
      - "18081"
      - "18089"
    command:
      - "--rpc-restricted-bind-ip=0.0.0.0"
      - "--rpc-restricted-bind-port=18089"
      - "--public-node"
      - "--no-igd"
      - "--enable-dns-blocklist"
      - "--prune-blockchain"
  tor:
    image: goldy/tor-hidden-service:latest
    environment:
        MONEROD_TOR_SERVICE_HOSTS: 18089:monerod:18089
        MONEROD_TOR_SERVICE_VERSION: '3'
    volumes:
      - /mnt/vol1/monero/tor:/var/lib/tor/hidden_service/
    networks: 
      - monero
    deploy:
      mode: replicated
      replicas: 1
      placement:
        constraints:
          - node.hostname != rpi
  gui:
    image: hvalev/monero-dashboard:latest
    networks:
      - monero
      - caddy
    environment:
      MONERO_HOST: monerod
      MONERO_PORT: 18081
      TICKER: "true"
      PORT: 3333
    deploy:
      mode: replicated
      replicas: 1
      labels:
        caddy: "monero.ca.varunpriolkar.com"
        caddy.reverse_proxy.to: "{{upstreams 3333}}"
        caddy.tls.dns: "route53"
        caddy.tls.dns.access_key_id: "{env.AWS_ACCESS_KEY}"
        caddy.tls.dns.secret_access_key: "{env.AWS_SECRET_KEY}"

networks:
  caddy:
    external: true
  monero:
    driver: overlay
    attachable: true

I'm assuming using "expose" keyword here should be enough:

    expose:
      - "18080"
      - "18081"
      - "18089"

However I can't seem to connect to 18081 from other container, just 18080 and 18089. Is there some option that I need to exclude in the commands? This is the output debugging it from the monero-gui container:

/home/monero # telnet monerod 18081
Trying 10.0.2.2...
telnet: Unable to connect to remote host: Connection refused
/home/monero # telnet monerod 18089
Trying 10.0.2.2...
Connected to monerod.
Escape character is '^]'.
^[^]
\q
telnet> Connection closed.
/home/monero # telnet monerod 18081
Trying 10.0.2.2...
telnet: Unable to connect to remote host: Connection refused
/home/monero # telnet monerod 18080
Trying 10.0.2.2...
Connected to monerod.
Escape character is '^]'.

Let me know if you need any more information. Thank you!

arhue commented 9 months ago

Looks like I didn't Google hard enough. Found the magic options:

--rpc-bind-ip=0.0.0.0 
--confirm-external-bind"

Incase anyone stumbles upon this. Sorry about the trouble.