Skip to content

Commit e6dc452

Browse files
committed
Fix in the entrypoint, move the config copy to the entrypoint script.
1 parent 1cd0e3e commit e6dc452

File tree

2 files changed

+14
-9
lines changed

2 files changed

+14
-9
lines changed

Dockerfile

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ MAINTAINER Tom Valk <tomvalk@lt-box.info>
33

44
ENV DEDICATED_URL http://files.v04.maniaplanet.com/server/ManiaplanetServer_2017-11-17.zip
55
ENV PROJECT_DIR /dedicated
6+
ENV TEMPLATE_DIR /dedicated-configs
67
WORKDIR /dedicated
78

89
# Install several dependencies.
@@ -19,6 +20,7 @@ RUN wget $DEDICATED_URL -qO /tmp/dedicated.zip
1920

2021
# Create folder and unpack, cleanup, prepare executables etc.
2122
RUN mkdir -p $PROJECT_DIR \
23+
&& mkdir -p $TEMPLATE_DIR \
2224
&& unzip -quo /tmp/dedicated.zip -d $PROJECT_DIR \
2325
&& rm /tmp/dedicated.zip \
2426
&& rm -rf $PROJECT_DIR/*.bat $PROJECT_DIR/*.exe $PROJECT_DIR/*.html $PROJECT_DIR/RemoteControlExamples \
@@ -31,9 +33,9 @@ RUN mkdir -p $PROJECT_DIR \
3133
&& mkdir -p $PROJECT_DIR/UserData/Maps/MatchSettings
3234

3335
# Install the dedicated configuration file(s).
34-
ADD config.default.xml $PROJECT_DIR/config.txt
35-
ADD matchsettings.default.xml $PROJECT_DIR/matchsettings.txt
36-
ADD stadium_map.Map.gbx $PROJECT_DIR/stadium_map.Map.gbx
36+
ADD config.default.xml $TEMPLATE_DIR/config.txt
37+
ADD matchsettings.default.xml $TEMPLATE_DIR/matchsettings.txt
38+
ADD stadium_map.Map.gbx $TEMPLATE_DIR/stadium_map.Map.gbx
3739

3840
# Install run script.
3941
ADD entrypoint.sh $PROJECT_DIR/start.sh

entrypoint.sh

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,17 @@ echo "=> Going to run on forced IP: ${FORCE_IP_ADDRESS} and port: ${FORCE_IP_POR
2020
: ${SERVER_NAME:="My Docker Server"}
2121

2222
# Copy the configuration files if not yet copied.
23-
if [ ! -f ./UserData/Config/config.txt ]; then
24-
cp config.txt UserData/Config/config.txt
23+
mkdir -p /dedicated/UserData/Config
24+
mkdir -p /dedicated/UserData/Packs
25+
mkdir -p /dedicated/UserData/Maps/MatchSettings
26+
if [ ! -f /dedicated/UserData/Config/config.txt ]; then
27+
cp /dedicated-configs/config.txt /dedicated/UserData/Config/config.txt
2528
fi
26-
if [ ! -f ./UserData/Maps/MatchSettings/default.txt ]; then
27-
cp matchsettings.txt UserData/Maps/MatchSettings/default.txt
29+
if [ ! -f /dedicated/UserData/Maps/MatchSettings/default.txt ]; then
30+
cp /dedicated-configs/matchsettings.txt /dedicated/UserData/Maps/MatchSettings/default.txt
2831
fi
29-
if [ ! -f ./UserData/Maps/stadium_map.Map.gbx ]; then
30-
cp stadium_map.Map.gbx UserData/Maps/stadium_map.Map.gbx
32+
if [ ! -f /dedicated/UserData/Maps/stadium_map.Map.gbx ]; then
33+
cp /dedicated-configs/stadium_map.Map.gbx /dedicated/UserData/Maps/stadium_map.Map.gbx
3134
fi
3235

3336
# Download title.

0 commit comments

Comments
 (0)