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.
77 lines
1.8 KiB
77 lines
1.8 KiB
###
|
|
### Build Variables
|
|
###
|
|
FROM localhost/debian:latest
|
|
|
|
# deploy options
|
|
# -p (port) and -v (volume) both go host:container
|
|
LABEL deployopts="\
|
|
-p 19132:19132/udp \
|
|
-p 19133:19133/udp \
|
|
-v /srv/vol/minecraft_bedrock/backup:/vol/backup"
|
|
|
|
# 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
|
|
|
|
# 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 && \
|
|
rm /home/mcadmin/.bashrc
|
|
|
|
###
|
|
### Minecraft
|
|
###
|
|
|
|
# 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 && \
|
|
unzip $(basename $url) && \
|
|
rm $(basename $url)
|
|
|
|
###
|
|
### Gitea
|
|
###
|
|
|
|
# dowload gitea
|
|
RUN wget https://dl.gitea.io/gitea/${giteav}/gitea-${giteav}-linux-amd64 && \
|
|
mv gitea /usr/local/bin/gitea && \
|
|
chmod +x /usr/local/bin/gitea
|
|
|
|
# make directories gitea needs
|
|
RUN mkdir -p /var/lib/gitea/ && \
|
|
cd /var/lib/gitea/ && \
|
|
mkdir custom data log && \
|
|
chown -R gitea:gitea /var/lib/gitea/ && \
|
|
chmod -R 750 /var/lib/gitea/
|
|
|
|
# copy gitea config template
|
|
COPY assets/app.ini.esh /etc/gitea/
|
|
# template config file
|
|
RUN cd /etc/gitea/ && \
|
|
esh app.ini.esh > app.ini && \
|
|
rm app.ini.esh && \
|
|
chmod -R +r /etc/gitea/
|
|
|
|
COPY assets/gitea.service /etc/systemd/system/
|
|
|
|
###
|
|
### Crontab
|
|
###
|
|
COPY assets/crontab /root/
|
|
RUN crontab -u gitea /root/crontab
|
|
|
|
###
|
|
### Bugfix
|
|
###
|
|
|
|
# execute command to workaround bug in cron
|
|
COPY bugfix/cronfix /root/
|
|
RUN chmod +x /root/cronfix && /root/cronfix
|
|
|