-
Notifications
You must be signed in to change notification settings - Fork 8
/
Dockerfile
73 lines (53 loc) · 2.42 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
ARG MTA_SERVER_VERSION=1.5.7
ARG MTA_SERVER_BUILD_NUMBER=20359
FROM alpine:latest as helper
ARG MTA_SERVER_VERSION
ARG MTA_SERVER_BUILD_NUMBER
WORKDIR /mtasa-rootfs
RUN apk add --no-cache --update wget tar
RUN wget https://nightly.mtasa.com/multitheftauto_linux_x64-${MTA_SERVER_VERSION}-rc-${MTA_SERVER_BUILD_NUMBER}.tar.gz -O /tmp/mtasa.tar.gz \
&& wget https://linux.mtasa.com/dl/baseconfig.tar.gz -P /tmp \
&& wget http://nightly.mtasa.com/files/modules/64/libmysqlclient.so.16 -P ./usr/lib \
&& mkdir lib && cp ./usr/lib/libmysqlclient.so.16 ./lib \
&& tar -xzvf /tmp/mtasa.tar.gz \
&& mv multitheftauto_linux_x64* mtasa \
&& mkdir mtasa/.default \
&& mkdir mtasa/x64/modules \
&& tar -xzvf /tmp/baseconfig.tar.gz -C mtasa/.default \
&& wget https://nightly.mtasa.com/files/modules/64/mta_mysql.so -P mtasa/x64/modules \
&& wget https://nightly.mtasa.com/files/modules/64/ml_sockets.so -P mtasa/x64/modules \
&& chmod go+rw mtasa -R \
&& chmod +x usr/lib/libmysqlclient.so.16 lib/libmysqlclient.so.16
# Main image
FROM debian:bullseye-slim
ARG MTA_SERVER_VERSION
ARG MTA_SERVER_BUILD_NUMBER
ENV MTA_SERVER_VERSION=${MTA_SERVER_VERSION} \
MTA_SERVER_BUILD_NUMBER=${MTA_SERVER_BUILD_NUMBER} \
MTA_DEFAULT_RESOURCES_URL=http://mirror.mtasa.com/mtasa/resources/mtasa-resources-latest.zip \
MTA_SERVER_ROOT_DIR=/mtasa \
MTA_SERVER_CONFIG_FILE_NAME=mtaserver.conf \
MTA_SERVER_PASSWORD= \
MTA_SERVER_PASSWORD_REPLACE_POLICY=when-empty
WORKDIR /mtasa
COPY --from=helper /mtasa-rootfs /
RUN groupadd -r mtasa && useradd --no-log-init -r -g mtasa mtasa \
&& chown mtasa:mtasa . \
&& mkdir /data /resources /resource-cache /native-modules \
&& chown -R mtasa:mtasa /data /resources /resource-cache /native-modules /mtasa \
&& chmod go+w /data /resources /resource-cache /native-modules \
&& apt-get update \
&& dpkg --add-architecture i386 \
&& apt-get install bash tar unzip libncursesw5 wget gdb -y \
&& apt-get autoclean -y \
&& apt-get autoremove -y
USER mtasa
RUN ls -la /mtasa/mods && rmdir ${MTA_SERVER_ROOT_DIR}/mods/deathmatch \
&& ln -sf /usr ${MTA_SERVER_ROOT_DIR}/mods/deathmatch \
&& ln -sfT /data ${MTA_SERVER_ROOT_DIR}/mods/deathmatch
COPY entrypoint.sh /
ENV TERM=xterm
EXPOSE 22003/udp 22005/tcp 22126/udp
VOLUME ["/resources", "/resource-cache", "/native-modules", "/data"]
ENTRYPOINT ["/entrypoint.sh"]
CMD ["-x", "-n", "-u"]