itzg / docker-minecraft-bedrock-server

Containerized Minecraft Bedrock Dedicated Server with selectable version
MIT License
1.14k stars 218 forks source link

2 ports ? #199

Open bitfreak030 opened 2 years ago

bitfreak030 commented 2 years ago

What does the second port do? 50707 Port is random after restart.

afbeelding

itzg commented 2 years ago

I have never know why it mentions two or more ports on the logs. 19132 is only one I know needs to be mapped.

bitfreak030 commented 2 years ago

its works great with the default port. Thank you for your answer.

fukurouchu commented 2 years ago

I seem to be having the same issue tho, even known my docker-compose file seems to be properly set up, after it says server started right after it gives another ipv4 log with a random port.

image image

fukurouchu commented 2 years ago

I seem to be having the same issue tho, even known my docker-compose file seems to be properly set up, after it says server started right after it gives another ipv4 log with a random port.

image image

Ok so I thought that it was actually stopping the server from working but it turns out that I just didn't set it up correctly on cloudflare, so it actually works despite it showing 2 ports.

nomad64 commented 2 years ago

This is a known issue with Bedrock Server: https://bugs.mojang.com/browse/BDS-3989. Seeing how long it has been open, it is not likely to get fixed any time soon. This bug is the primary reason I use docker for Bedrock Servers.

When running multiple server containers on a single host, be sure to specify SERVER_PORT and the ports: section with the same port. So if you wanted to run a server on port 23456, your config would look something like:

version: '3.4'
services:
  birthday:
    image: itzg/minecraft-bedrock-server:latest
    environment:
      SERVER_PORT: "23456"
  ...
    ports:
      - 23456:23456/udp

When your server container starts, it will still show two ports: 23456 and 19132. However, since you are only exporting 23456, you can safely ignore the other port.

Hamsterman commented 2 years ago

SERVER_PORT: "23456"

I found when setting SERVER_PORT: "19132" only one port shows in the log. This will also render the container Unhealthy - so maybe not a way to go.

itzg commented 2 years ago

@Hamsterman thats odd since that's already the default from the image

https://github.com/itzg/docker-minecraft-bedrock-server/blob/8a2f1bfeada27aad8208991ec7de20b23cb376c0/Dockerfile#L46

Hamsterman commented 2 years ago

I just tried it again - it's unhealthy

minecraft_bedrock:
    image: itzg/minecraft-bedrock-server
    container_name: minecraft_bedrock
    ports:
        - "19132:19132/udp"
    environment: 
        - EULA=TRUE            
        - SERVER_PORT="19132"
    tty: true
    stdin_open: true
    restart: unless-stopped
    volumes:
        - //myfolder/minecraft-bedrock:/data
itzg commented 2 years ago

@Hamsterman with list-style environment don't include the quotes. "19132" is getting literally set in server.properties.

Hamsterman commented 2 years ago

@Hamsterman with list-style environment don't include the quotes. "19132" is getting literally set in server.properties.

Ah yes - that was an error.