Skip to content

Commit f619d77

Browse files
committed
Merge remote-tracking branch 'origin/main'
2 parents b9902ed + 0057da7 commit f619d77

File tree

5 files changed

+43
-69
lines changed

5 files changed

+43
-69
lines changed

Dockerfile.j2

Lines changed: 16 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,16 @@
1-
#
2-
# LinuxGSM {{ gamename }} Dockerfile
3-
#
4-
# https://github.com/GameServerManagers/docker-gameserver
5-
#
6-
7-
FROM ghcr.io/gameservermanagers/linuxgsm:{{ distro }}
8-
LABEL maintainer="LinuxGSM <me@danielgibbs.co.uk>"
9-
ARG SHORTNAME={{ shortname }}
10-
ENV GAMESERVER={{ shortname }}server
11-
12-
WORKDIR /app
13-
14-
## Auto install game server requirements
15-
RUN depshortname=$(curl --connect-timeout 10 -s https://raw.githubusercontent.com/GameServerManagers/LinuxGSM/master/lgsm/data/{{ distro }}.csv |awk -v shortname="{{ shortname }}" -F, '$1==shortname {$1=""; print $0}') \
16-
&& if [ -n "${depshortname}" ]; then \
17-
echo "**** Install ${depshortname} ****" \
18-
&& apt-get update \
19-
&& apt-get install -y ${depshortname} \
20-
&& apt-get -y autoremove \
21-
&& apt-get clean \
22-
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*; \
23-
fi
24-
25-
HEALTHCHECK --interval=1m --timeout=1m --start-period=2m --retries=1 CMD /app/entrypoint-healthcheck.sh || exit 1
26-
27-
RUN date > /build-time.txt
28-
29-
ENTRYPOINT ["/bin/bash", "./entrypoint.sh"]
1+
# # LinuxGSM {{ gamename }} Dockerfile # #
2+
https://github.com/GameServerManagers/docker-gameserver # FROM
3+
ghcr.io/gameservermanagers/linuxgsm:{{ distro }} LABEL maintainer="LinuxGSM
4+
<me@danielgibbs.co.uk
5+
>" ARG SHORTNAME={{ shortname }} ENV GAMESERVER={{ shortname }}server WORKDIR
6+
/app ## Auto install game server requirements RUN depshortname=$(curl
7+
--connect-timeout 10 -s
8+
https://raw.githubusercontent.com/GameServerManagers/LinuxGSM/master/lgsm/data/{{ distro }}.csv
9+
|awk -v shortname="{{ shortname }}" -F, '$1==shortname {$1=""; print $0}') \
10+
&& if [ -n "${depshortname}" ]; then \ echo "**** Install ${depshortname}
11+
****" \ && apt-get update \ && apt-get install -y ${depshortname} \ && apt-get
12+
-y autoremove \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* /tmp/*
13+
/var/tmp/*; \ fi HEALTHCHECK --interval=1m --timeout=1m --start-period=2m
14+
--retries=1 CMD /app/entrypoint-healthcheck.sh || exit 1 RUN date >
15+
/build-time.txt ENTRYPOINT ["/bin/bash", "./entrypoint.sh"]
16+
</me@danielgibbs.co.uk>

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ For a list of available game servers visit [linuxgsm.com](https://linuxgsm.com)
2323

2424
Here is an example docker-compose configuration for the "csgoserver" using the image `gameservermanagers/gameserver:csgo`. Please note that the ports may vary depending on the specific game server. More docker-compose examples are available [docker-compose examples](https://github.com/GameServerManagers/docker-gameserver/tree/main/docker-compose).
2525

26-
``` yaml
27-
version: '3.4'
26+
```yaml
27+
version: "3.4"
2828
services:
2929
linuxgsm-csgo:
3030
image: gameservermanagers/gameserver:csgo
@@ -44,7 +44,7 @@ services:
4444
4545
Alternatively, you can use the Docker CLI to run the container:
4646
47-
``` bash
47+
```bash
4848
docker run -d \
4949
--name csgoserver \
5050
-v /path/to/csgoserver:/data \
@@ -79,6 +79,6 @@ This container uses gosu to run gameservers as the `linuxgsm` user instead of ro
7979

8080
You can execute LinuxGSM commands within the container using the docker exec command. Here's an example to run the `./csgoserver details` command as the `linuxgsm` user:
8181

82-
``` bash
82+
```bash
8383
docker exec -it --user linuxgsm csgoserver ./csgoserver details
8484
```

docker-compose.yml.j2

Lines changed: 11 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,11 @@
1-
version: "3.8"
2-
services:
3-
# bind mount example
4-
linuxgsm-{{ shortname }}-bind:
5-
image: gameservermanagers/gameserver:{{ shortname }}
6-
# image: ghcr.io/gameservermanagers/gameserver:{{ shortname }}
7-
container_name: {{ shortname }}server
8-
restart: unless-stopped
9-
volumes:
10-
- /path/to/linuxgsm/{{ shortname }}server:/data
11-
network_mode: host
12-
13-
# volume example
14-
linuxgsm-{{ shortname }}-volume:
15-
image: gameservermanagers/gameserver:{{ shortname }}
16-
# image: ghcr.io/gameservermanagers/gameserver:{{ shortname }}
17-
container_name: {{ shortname }}server
18-
restart: unless-stopped
19-
volumes:
20-
- linuxgsm-{{ shortname }}:/data
21-
network_mode: host
22-
23-
volumes:
24-
linuxgsm-{{ shortname }}:
1+
version: "3.8" services: # bind mount example linuxgsm-{{ shortname }}-bind:
2+
image: gameservermanagers/gameserver:{{ shortname }} # image:
3+
ghcr.io/gameservermanagers/gameserver:{{ shortname }} container_name:
4+
{{ shortname }}server restart: unless-stopped volumes: -
5+
/path/to/linuxgsm/{{ shortname }}server:/data network_mode: host # volume
6+
example linuxgsm-{{ shortname }}-volume: image:
7+
gameservermanagers/gameserver:{{ shortname }} # image:
8+
ghcr.io/gameservermanagers/gameserver:{{ shortname }} container_name:
9+
{{ shortname }}server restart: unless-stopped volumes: -
10+
linuxgsm-{{ shortname }}:/data network_mode: host volumes:
11+
linuxgsm-{{ shortname }}:

generate-docker-compose.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
curl -O "https://raw.githubusercontent.com/GameServerManagers/LinuxGSM/master/lgsm/data/serverlist.csv"
44

5-
echo -n "{" >"shortnamearray.json"
6-
echo -n "\"include\":[" >>"shortnamearray.json"
5+
echo -n "{" > "shortnamearray.json"
6+
echo -n "\"include\":[" >> "shortnamearray.json"
77

88
while read -r line; do
99
shortname=$(echo "$line" | awk -F, '{ print $1 }')
@@ -16,10 +16,10 @@ while read -r line; do
1616
export distro
1717
touch "docker-compose/docker-compose-${shortname}.yml"
1818
echo "Generating docker-compose-${shortname}.yml (${gamename})"
19-
jinjanate docker-compose.yml.j2 >"docker-compose/docker-compose-${shortname}.yml"
20-
{ printf '{"shortname":"%s"},' "$shortname"; } >>"shortnamearray.json"
19+
jinjanate docker-compose.yml.j2 > "docker-compose/docker-compose-${shortname}.yml"
20+
{ printf '{"shortname":"%s"},' "$shortname"; } >> "shortnamearray.json"
2121
done < <(tail -n +1 serverlist.csv)
2222
sed -i '$ s/.$//' "shortnamearray.json"
23-
echo -n "]" >>"shortnamearray.json"
24-
echo -n "}" >>"shortnamearray.json"
23+
echo -n "]" >> "shortnamearray.json"
24+
echo -n "}" >> "shortnamearray.json"
2525
rm serverlist.csv

generate-dockerfiles.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
curl -O "https://raw.githubusercontent.com/GameServerManagers/LinuxGSM/master/lgsm/data/serverlist.csv"
44

5-
echo -n "{" >"shortnamearray.json"
6-
echo -n "\"include\":[" >>"shortnamearray.json"
5+
echo -n "{" > "shortnamearray.json"
6+
echo -n "\"include\":[" >> "shortnamearray.json"
77

88
while read -r line; do
99
shortname=$(echo "$line" | awk -F, '{ print $1 }')
@@ -16,10 +16,10 @@ while read -r line; do
1616
export distro
1717
touch "dockerfiles/Dockerfile-${shortname}"
1818
echo "Generating Dockerfile-${shortname} (${gamename})"
19-
jinjanate Dockerfile.j2 >"dockerfiles/Dockerfile-${shortname}"
20-
{ printf '{"shortname":"%s"},' "$shortname"; } >>"shortnamearray.json"
19+
jinjanate Dockerfile.j2 > "dockerfiles/Dockerfile-${shortname}"
20+
{ printf '{"shortname":"%s"},' "$shortname"; } >> "shortnamearray.json"
2121
done < <(tail -n +2 serverlist.csv)
2222
sed -i '$ s/.$//' "shortnamearray.json"
23-
echo -n "]" >>"shortnamearray.json"
24-
echo -n "}" >>"shortnamearray.json"
23+
echo -n "]" >> "shortnamearray.json"
24+
echo -n "}" >> "shortnamearray.json"
2525
rm serverlist.csv

0 commit comments

Comments
 (0)