You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
53 lines
1.4 KiB
53 lines
1.4 KiB
###
|
|
### Build Variables
|
|
###
|
|
FROM localhost/debian:latest
|
|
|
|
# deploy options
|
|
# -p (port) and -v (volume) both go host:container
|
|
LABEL config_default="\
|
|
-p 19132-19133:19132-19133 \
|
|
-p 19132-19133:19132-19133/udp \
|
|
-v /srv/vol/mcbe/data:/vol/data"
|
|
|
|
# Build variables
|
|
# uid that the files owner user should have
|
|
ARG FILESUID=5000
|
|
|
|
###
|
|
### General Setup
|
|
###
|
|
|
|
# install packages we want
|
|
RUN apt update -y && apt install -y libcurl4 zip
|
|
|
|
# create minecraft server user with file owner UID
|
|
RUN addgroup --gid $FILESUID mcadmin && \
|
|
adduser mcadmin --ingroup mcadmin --uid $FILESUID --disabled-password --gecos "Minecraft Server Admin" --shell /usr/sbin/nologin
|
|
|
|
# Copy custom scripts
|
|
COPY assets/bin/ /usr/local/bin/
|
|
|
|
###
|
|
### Minecraft
|
|
###
|
|
WORKDIR /home/mcadmin
|
|
|
|
# download Minecraft Bedrock dedicated server
|
|
RUN url=$(wget -q https://www.minecraft.net/en-us/download/server/bedrock/ -O - | grep -Eo 'https://[^ ]+bin-linux/bedrock-server-[^ ]+\.zip' | head -n 1) && \
|
|
wget $url && \
|
|
echo "Unzipping ..." && \
|
|
unzip -q $(basename $url) && \
|
|
rm $(basename $url) && \
|
|
chown -R mcadmin:mcadmin ./
|
|
|
|
# make links to minecraft config
|
|
RUN for f in permissions.json server.properties whitelist.json ; \
|
|
do rm $f && ln -s /vol/data/config/$f ./ ; \
|
|
done
|
|
|
|
# copy units to systemd
|
|
COPY assets/systemd/ /etc/systemd/system/
|
|
|
|
# enable systemd units
|
|
RUN systemctl enable mcbe.service mcbe-backup.timer
|
|
|