minecraft-docker/README.md

59 lines
1.4 KiB
Markdown
Raw Normal View History

2024-02-17 12:28:57 +01:00
# minecraft-docker
2024-04-03 21:31:17 +02:00
A docker container for running a minecraft server!
2024-02-17 12:28:57 +01:00
## Network setup
To setup the network you just need to use this command to create a network.
```
docker network create -d bridge minecraft-stack
```
2024-04-03 21:31:17 +02:00
(You can use this for multiple servers, like setting up a proxy like bungee or velocity.)
2024-02-17 12:28:57 +01:00
## Configuring
2024-04-03 21:31:17 +02:00
By default, the compose file won't work. To make it work, you need to add your name for your server, like -smp, and you will also need to set an IP for it. (I will give you an example on how to set it up for a proxy.)
2024-02-17 12:28:57 +01:00
```
version: "3.8"
networks:
customnetwork:
external: true
name: minecraft-stack
services:
minecraft-proxy:
restart: always
image: minecraft-proxy
build: ./minecraft-docker
command: ["java", "-Xmx2048M", "-jar", "server.jar", "true"]
networks:
customnetwork:
ipv4_address: 192.168.16.2
volumes:
- "./data:/root/minecraft"
ports:
- "25565:25565"
- "8001:8001" # RCON (REMOTE CONSOLE)
```
Happy configuring!
## Building
2024-04-03 21:31:17 +02:00
You need to build the image now. To do that, use this command:
2024-02-17 12:28:57 +01:00
```
docker-compose build
```
## Spinning them up!
2024-04-03 21:31:17 +02:00
To first test it, run the container without -d, but when all else fails, just use -d (example):
2024-02-17 12:28:57 +01:00
### Without -d for testing
```
docker-compose up
```
### With -d for daemoninzing
```
docker-compose up -d
```
# Contributors
- DRAGONTOS