Skip to content

Commit 173ce48

Browse files
committed
set_host script
1 parent 8cd3fa2 commit 173ce48

File tree

5 files changed

+14
-7
lines changed

5 files changed

+14
-7
lines changed

docker-compose.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,3 @@ services:
66
build: ./src
77
ports:
88
- 25565:25565
9-
volumes:
10-
- ./src/minecraft.conf:/opt/nginx/stream.conf.d/minecraft.conf:ro

src/Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ RUN adduser --system --no-create-home --disabled-login --disabled-password --gro
2424
RUN mkdir /opt/nginx/http.conf.d && mkdir /opt/nginx/stream.conf.d
2525

2626
ADD nginx.conf /opt/nginx/conf/nginx.conf
27-
ADD zero_downtime_reload.sh /opt/nginx/sbin/zero_downtime_reload.sh
27+
ADD set_host.sh /opt/nginx/sbin/set_host.sh
28+
ADD minecraft.template.conf /opt/minecraft.template.conf
2829

2930
WORKDIR /
3031

File renamed without changes.

src/set_host.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/bin/bash
2+
3+
sourceFile="/opt/minecraft.template.conf"
4+
configFile="/opt/nginx/stream.conf.d/minecraft.conf"
5+
6+
nginxFile="/opt/nginx/sbin/nginx"
7+
8+
yes | cp -fi "$sourceFile" "$configFile" &> /dev/null
9+
10+
sed -i "s/<minecraft>/$1/" "$configFile"
11+
12+
$nginxFile -s reload

src/zero_downtime_reload.sh

Lines changed: 0 additions & 4 deletions
This file was deleted.

0 commit comments

Comments
 (0)