forked from itzg/docker-mc-proxy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
46 lines (34 loc) · 1.55 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
FROM openjdk:8-alpine
VOLUME ["/server"]
WORKDIR /server
# upgrade all packages since alpine jre8 base image tops out at 8u212
RUN apk -U --no-cache upgrade
RUN apk -U --no-cache add curl bash sudo jq fontconfig ttf-dejavu
ENV SERVER_PORT=25577 ENABLE_RCON=true RCON_PORT=25575
EXPOSE $SERVER_PORT
RUN set -x \
&& addgroup -g 1000 -S bungeecord \
&& adduser -u 1000 -D -S -G bungeecord bungeecord \
&& addgroup bungeecord wheel
# hook into docker BuildKit --platform support
# see https://docs.docker.com/engine/reference/builder/#automatic-platform-args-in-the-global-scope
ARG TARGETOS=linux
ARG TARGETARCH=amd64
ARG TARGETVARIANT=""
ARG EASY_ADD_VER=0.7.1
ADD https://github.com/itzg/easy-add/releases/download/${EASY_ADD_VER}/easy-add_${TARGETOS}_${TARGETARCH}${TARGETVARIANT} /usr/bin/easy-add
RUN chmod +x /usr/bin/easy-add
# Add healthcheck
RUN easy-add --var os=${TARGETOS} --var arch=${TARGETARCH}${TARGETVARIANT} \
--var version=0.6.0 --var app=mc-monitor --file {{.app}} \
--from https://github.com/itzg/{{.app}}/releases/download/{{.version}}/{{.app}}_{{.version}}_{{.os}}_{{.arch}}.tar.gz
COPY health.sh /
RUN dos2unix /health.sh && chmod +x /health.sh
# Add rcon
RUN easy-add --var os=${TARGETOS} --var arch=${TARGETARCH}${TARGETVARIANT} \
--var version=1.4.7 --var app=rcon-cli --file {{.app}} \
--from https://github.com/itzg/{{.app}}/releases/download/{{.version}}/{{.app}}_{{.version}}_{{.os}}_{{.arch}}.tar.gz
COPY rcon-config.yml /tmp/rcon-config.yml
CMD ["/usr/bin/run-bungeecord.sh"]
HEALTHCHECK --start-period=10s CMD /health.sh
COPY *.sh /usr/bin/