Skip to content

Commit ba10a70

Browse files
committed
feat(docker): add .prettierignore and format Dockerfile and docker-compose.yml
* Introduced a `.prettierignore` file to exclude specific templates from formatting. * Reformatted `Dockerfile.j2` for improved readability and maintainability. * Enhanced structure of `docker-compose.yml.j2` for clarity and consistency.
1 parent fa611e7 commit ba10a70

File tree

3 files changed

+55
-27
lines changed

3 files changed

+55
-27
lines changed

.prettierignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Dockerfile.j2
2+
docker-compose.yml.j2

Dockerfile.j2

Lines changed: 29 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,29 @@
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>
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"]

docker-compose.yml.j2

Lines changed: 24 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,24 @@
1-
services: # bind mount example linuxgsm-{{ shortname }}-bind: image:
2-
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 }}:
1+
---
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 }}:

0 commit comments

Comments
 (0)