-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
38 lines (29 loc) · 1.21 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
FROM centos:8
LABEL maintainer="João Marques <[email protected]>"
# Define some build arguments
ARG user=LinuxGSM
ARG uid=5000
ARG gid=5000
# Setup dependencies
RUN dnf install -y --allowerasing epel-release file nmap-ncat curl wget tar bzip2 gzip unzip python3 binutils bc jq tmux diffutils ncurses glibc.i686 libstdc++.i686 libcurl.i686
# Setup user
RUN groupadd --gid ${gid} ${user}
RUN useradd --create-home --shell /bin/bash --uid ${uid} --gid ${gid} ${user}
# Change working directory and user
WORKDIR /home/${user}
USER ${user}
# Download and install LinuxGSM
RUN curl -L https://linuxgsm.sh --output linuxgsm.sh
RUN chmod +x linuxgsm.sh
# Install Dont Starve Together server
RUN ./linuxgsm.sh dstserver
RUN ./dstserver auto-install
# Copy configuration
COPY --chown=${user}:${user} build/*.cfg lgsm/config-lgsm/dstserver/
COPY --chown=${user}:${user} build/cluster .klei/DoNotStarveTogether/Cluster_1/
# Copy entrypoint
COPY --chown=${user}:${user} build/entrypoint.sh ./entrypoint.sh
RUN chmod +x entrypoint.sh
# Start Server
HEALTHCHECK --interval=1m --timeout=30s --start-period=1m --retries=3 CMD [ "./dstserver", "monitor", "||", "exit", "1" ]
ENTRYPOINT [ "./entrypoint.sh" ]