Files
docker_minecraft_server_aut…/docker-compose.yml
2023-12-27 16:21:45 +01:00

47 lines
1.6 KiB
YAML

version: "3.9"
services:
auto_starter:
container_name: mc_auto_starter
restart: no
image: dertyp7/minecraft_server_auto_starter:latest
ports:
- 25565:25565
- 25566:25566
environment:
# Port mapping for the servers
# The key is the external port of the placeholder server
# The value is the internal ip of the actual server
# Don't change the server port in the actual server. Use this instead
PORT_MAP: |
25565: "mc"
25566: "mc2"
volumes:
- /var/run/docker.sock:/var/run/docker.sock
# These are the actual servers
# For itzg/minecraft-server you can find the documentation here: https://docker-minecraft-server.readthedocs.io/en/latest/variables/
mc:
container_name: example_mc_server_1
image: itzg/minecraft-server
restart: unless-stopped #! This is important. If you restart the server always automatically, the auto_starter will not work
environment:
type: "PAPER"
EULA: "TRUE"
MOTD: "Example Server 1"
MAX_PLAYERS: "1"
#! Dont change SERVER_PORT. Use PORT_IP_MAP in auto_starter instead.
# SERVER_PORT default is "25565"
mc2:
container_name: example_mc_server_2
image: itzg/minecraft-server
restart: unless-stopped #! This is important. If you restart the server always automatically, the auto_starter will not work
environment:
type: "PAPER"
EULA: "TRUE"
MOTD: "Example Server 2"
MAX_PLAYERS: "1"
#! Dont change SERVER_PORT. Use PORT_IP_MAP in auto_starter instead.
# SERVER_PORT default is "25565"