-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdocker-compose.yaml
43 lines (41 loc) · 1.46 KB
/
docker-compose.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# version: '3.9' # >=3.8 required to set container resource limits
services:
minecraft:
# entrypoint: bash
container_name: minecraft
# image expected to be built using `make build-docker` instead of mucking
# around with a build key & args here
build:
context: .
# Need to set these for both build-time and runtime
args:
bedrock_version: "${bedrock_version}"
java_version: "${java_version}"
hostuid: "${hostuid}"
edition: "${edition}"
level_name: "${level_name}"
network: 'host' # see below for why
environment:
bedrock_version: "${bedrock_version}"
java_version: "${java_version}"
hostuid: "${hostuid}"
edition: "${edition}"
level_name: "${level_name}"
image: 'ryapric/minecraft-server-${level_name}:latest'
command: "${edition}" # provided by Makefile
volumes:
- "./data:/home/minecraft/minecraft-docker/${edition}/worlds"
# `host` is set here in case this image is building/running in e.g. a
# homelab running nonstandard DNS (e.g. Pi-Hole), and the container needs to
# resolve to something reachable. If something about this breaks, take this
# line out and replace it with the ports section below.
network_mode: 'host'
# ports:
# - '25565:25565/tcp'
# - '25565:25565/udp'
# - '19132:19132/tcp'
# - '19132:19132/udp'
stdin_open: true
tty: true
restart: always
cpus: "${cpus:-3.0}"