-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathDockerfile
executable file
·57 lines (45 loc) · 1.28 KB
/
Dockerfile
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
FROM ubuntu:22.04
# install dependencies
RUN apt update && \
apt install -y curl unzip && \
apt clean && \
apt clean autoclean && \
rm -rf /var/lib/apt/lists/*
# build arguments
ARG MCPORT
ARG INSTALLERBASE
ARG INSTALLERURL
ARG MCUSER
ARG MCGROUP
ARG VERSION
ARG AUTOUPDATE
ENV MCUSER=${MCUSER:-1132}
ENV MCGROUP=${MCGROUP:-1132}
ENV MCPORT=${MCPORT:-19132}
ENV VERSION=${VERSION:-"1.20.0.01"}
ENV INSTALLERBASE=${INSTALLERBASE:-"https://minecraft.azureedge.net/bin-linux/bedrock-server-"}
ENV AUTOUPDATE=${AUTOUPDATE:-1}
# setup environment
ENV container=docker
ENV WORLD='world'
ENV MCSERVERFOLDER="/srv/bedrockserver"
ENV MCVOLUME=/mcdata
ENV PATH $PATH:${MCSERVERFOLDER}
# open the server port
EXPOSE $MCPORT
# make dirs
RUN mkdir -p $MCSERVERFOLDER/default $MCVOLUME
# copy resource files over
COPY resource/* $MCSERVERFOLDER/
# fix permissions
RUN chown -Rf $MCUSER:$MCGROUP $MCSERVERFOLDER $MCVOLUME && \
chmod -Rf g=u $MCSERVERFOLDER $MCVOLUME && \
chmod +x $MCSERVERFOLDER/*.sh
# set default user to minecraft user
USER $MCUSER:$MCGROUP
# create volume for minecraft resources
VOLUME $MCVOLUME
# install bedrock server
RUN if [ $AUTOUPDATE = 1 ]; then touch $MCSERVERFOLDER/.AUTOUPDATE; fi && \
$MCSERVERFOLDER/installbedrockserver.sh $VERSION
CMD ["runbedrockserver.sh"]