Repository navigation
Deployment
Services | Scripts | Persistence
The idea of using Docker as a deployment tool came naturally when we decided about hosting a Minecraft server. Docker has been around for enough time to have substantial documentation and support online, and as for minecraft even longer.
Deploying a docker container can be as straightforward as running docker run <image>
However automating an entire setup requires more configuration. For this purpose we use Docker-Compose that allows us to configure many containers in one go.
Here we are setting the details of two services that will run in their own containers:
sqldb:
image: mysql:5.7
command: --default-authentication-plugin=mysql_native_password
volumes:
- "./db_data:/var/lib/mysql"
- "./docker-scripts:/docker-entrypoint-initdb.d"
restart: always
ports:
- "3306:3306"
expose:
- "3306"
environment:
MYSQL_ROOT_PASSWORD: skt
# MYSQL_DATABASE: dynmap
MYSQL_USER: pingu
MYSQL_PASSWORD: skt
networks:
- mcnet
spigot:
depends_on:
- sqldb
build:
context: .
dockerfile: Dockerfile
links:
- sqldb:sqldb
expose:
- "22"
- "25565"
- "8123"
- "25575"
ports:
- "2220:22" # ssh
- "25565:25565" # minecraft
- "8123:8123" # dynmap
- "25575:25575" # rcon
volumes:
- ./mc:/data
environment:
XMS: "16G" # Starting Memory
XMX: "16G" # Max Memory Usage
EULA: "TRUE"
networks:
- mcnet
Through scripts such as this setup.sh we download some files that does not need to be on our GitHub.
# Download Spigot
curl -L -o /data/spigot.jar https://download.getbukkit.org/spigot/spigot-1.17.1.jar
We allocate a space on the server to save the world generated by Minecraft.
# sqldb
volumes:
- "./db_data:/var/lib/mysql"
- "./docker-scripts:/docker-entrypoint-initdb.d"
# spigot
volumes:
- "./mc:/data"
FlipFlop - A minecraft server project
Content: Docker | Scripts | Persistance
Content: Users | Network | Accessibility | Backup | Risk-Analysis