MCHPR / MCHPRS

A multithreaded Minecraft server built for redstone.
MIT License
1.56k stars 67 forks source link

Docker volumes causes server to not respond properly #79

Open Marterido opened 1 year ago

Marterido commented 1 year ago

Hey! I got a small problem with running MCHPRS using docker. When I run the dockerfile that is in the repo using docker-compose everything is fine, but I woud love to have the /data directory to be a volume that is linked to my local machine so I can more easily add and remove schems and configuration.

When I start the container with docker-compose everything seems to work just fine. Everything builds the way it should and everything runs with no problem. But my issue arrives when I try to log into the server. I get a message that I joined the server but the world won’t load and everything seems to be frozen. After a few seconds I get timed out, but the server stays up like nothing happened. It’ll just show a message that I left the server.

Is this a bug or am I doing something wrong (probably the most likely)?

version: "3.9"

services:
    mchprs:
        container_name: mchprs_server
        restart: unless-stopped
        build:
            context: .
            dockerfile: dockerfile
        ports:
            - "25565:25565"
        volumes:
            - ./server:/data
FROM rustlang/rust:nightly-slim

RUN apt-get update \
    && apt-get install -y \
    git pkg-config libssl-dev

RUN git clone https://github.com/MCHPR/MCHPRS.git
WORKDIR /MCHPRS
RUN cargo install --path . \
    && cargo clean

VOLUME [ "/data" ]
WORKDIR /data

CMD ["mchprs"]