-
Notifications
You must be signed in to change notification settings - Fork 5
/
Dockerfile
74 lines (56 loc) · 2.36 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
74
FROM debian:bookworm
# Prerequisites
RUN apt-get -y update && apt-get install -y --no-install-recommends ca-certificates wget unzip openssl libncursesw5 libc6
# Retreving older libssl version for mtasa
RUN wget -O libssl-1.1.deb http://ftp.de.debian.org/debian/pool/main/o/openssl/libssl1.1_1.1.1w-0+deb11u1_amd64.deb && \
apt install -y ./libssl-1.1.deb && \
rm libssl-1.1.deb
# Set timezone
ENV TZ=Europe/Berlin
RUN echo $TZ | tee /etc/timezone && \
dpkg-reconfigure --frontend noninteractive tzdata
# Setup user and change to its home
RUN useradd -u 5000 -m -d /var/lib/mtasa/ mtasa
WORKDIR /var/lib/mtasa
# Download and install MTA Server
RUN wget -q -O mta.tar.gz https://linux.multitheftauto.com/dl/multitheftauto_linux_x64.tar.gz && \
tar xfz mta.tar.gz && mv multitheftauto*/* ./ && \
ls -ls && \
rm -Rf multitheftauto* && \
rm mta.tar.gz
# Download default resources
RUN mkdir /var/lib/mtasa/mods/deathmatch/resources && \
cd /var/lib/mtasa/mods/deathmatch/resources && \
wget -O res.zip https://mirror-cdn.multitheftauto.com/mtasa/resources/mtasa-resources-latest.zip && \
unzip res.zip && \
rm res.zip
# Create modules directory and delete bad shipped libs
RUN mkdir /var/lib/mtasa/x64/modules && \
rm -Rf /var/lib/mtasa/x64/linux-libs
# Expose ports (22003/udp, 22126/udp, 22005/tcp are exposed dynamically)
EXPOSE 8080/tcp
# Add subproject artitifacts
ADD build/workerserver /var/lib/mtasa/workerserver
ADD build/ml_gps.so /var/lib/mtasa/x64/modules/ml_gps.so
ADD build/ml_jwt.so /var/lib/mtasa/x64/modules/ml_jwt.so
# Add entrypoint script
ADD build/docker-entrypoint.sh /docker-entrypoint.sh
# Add MTA configs and modules
ADD build/config/* /var/lib/mtasa/mods/deathmatch/
ADD build/modules/* /var/lib/mtasa/x64/modules/
# Add MTA resources
ADD artifacts.tar.gz /var/lib/mtasa/mods/deathmatch/resources/
# Remove config files to ensure they are copied to the exposed volume on start
RUN rm /var/lib/mtasa/mods/deathmatch/resources/vrp_build/server/config/*
# Update permissions
RUN chown -R mtasa:mtasa /var/lib/mtasa && \
chmod +x /var/lib/mtasa/workerserver && \
chmod +x /docker-entrypoint.sh
# Expose config directory
VOLUME /var/lib/mtasa/mods/deathmatch/resources/vrp_build/server/config
# Expose server data dirs
VOLUME /var/lib/mtasa/mods/deathmatch/logs
VOLUME /var/lib/mtasa/mods/deathmatch/dumps
# Start commands
USER mtasa
CMD ["/docker-entrypoint.sh"]