-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
62 lines (46 loc) · 1.88 KB
/
Dockerfile
File metadata and controls
62 lines (46 loc) · 1.88 KB
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
ARG FIVEM_NUM=5820
ARG FIVEM_VER=5820-8e883dcc7941ce1fa5de359ede53afe587070723
ARG DATA_VER=b907aa74e2826e363979332ac21b9ad98cd82aa1
FROM wodby/mariadb:latest as builder
ARG FIVEM_VER
ARG DATA_VER
WORKDIR /output
USER root
RUN apk add --no-cache tini mariadb-dev tzdata xz \
&& rm -f /var/cache/apk/*
RUN wget http://runtime.fivem.net/artifacts/fivem/build_proot_linux/master/${FIVEM_VER}/fx.tar.xz \
&& tar -xf fx.tar.xz --strip-components=1 --exclude alpine/dev --exclude alpine/proc --exclude alpine/run --exclude alpine/sys \
&& rm fx.tar.xz \
&& mkdir -p opt/cfx-server-data \
&& wget -O ${DATA_VER}.tar.gz https://codeload.github.com/citizenfx/cfx-server-data/tar.gz/${DATA_VER} \
&& tar -zxvf ${DATA_VER}.tar.gz --strip-components=1 -C opt/cfx-server-data \
&& rm ${DATA_VER}.tar.gz
ADD server.cfg opt/cfx-server-data
ADD resources.tar opt/cfx-server-data
ADD database.sql opt/cfx-server-data
ADD entrypoint usr/bin/entrypoint
RUN chmod +x /output/usr/bin/entrypoint
#================
FROM scratch
ARG FIVEM_VER
ARG FIVEM_NUM
ARG DATA_VER
LABEL org.label-schema.name="FiveM" \
org.label-schema.url="https://fivem.net" \
org.label-schema.description="FiveM is a modification for Grand Theft Auto V enabling you to play multiplayer on customized dedicated servers." \
org.label-schema.version=${FIVEM_NUM}
COPY --from=builder /output/ /
WORKDIR /config
RUN apk add --no-cache mariadb mariadb-client mariadb-server-utils pwgen tzdata tini && \
rm -f /var/cache/apk/*
ADD files/run.sh /scripts/run.sh
RUN mkdir /docker-entrypoint-initdb.d && \
mkdir /scripts/pre-exec.d && \
mkdir /scripts/pre-init.d && \
chmod -R 755 /scripts
EXPOSE 3306
EXPOSE 30120
VOLUME ["/var/lib/mysql"]
# Default to an empty CMD, so we can use it to add seperate args to the binary
CMD [""]
ENTRYPOINT ["/sbin/tini", "--", "/usr/bin/entrypoint"]