working on world name selection
This commit is contained in:
parent
22668fa16e
commit
253a7868d1
|
@ -34,6 +34,7 @@ RUN rm -rf /home/minetest/minetest-source/
|
||||||
|
|
||||||
USER minetest
|
USER minetest
|
||||||
WORKDIR /usr/local/share/minetest
|
WORKDIR /usr/local/share/minetest
|
||||||
|
RUN mkdir -p worlds
|
||||||
|
|
||||||
EXPOSE 30000/udp
|
EXPOSE 30000/udp
|
||||||
ENTRYPOINT ["/entrypoint.sh"]
|
ENTRYPOINT ["/entrypoint.sh"]
|
|
@ -3,16 +3,16 @@ services:
|
||||||
environment:
|
environment:
|
||||||
- SERVER_GAME
|
- SERVER_GAME
|
||||||
- SERVER_ADMIN
|
- SERVER_ADMIN
|
||||||
|
- WORLD_NAME
|
||||||
build:
|
build:
|
||||||
context: .
|
context: .
|
||||||
restart: always
|
restart: always
|
||||||
network_mode: host
|
network_mode: host
|
||||||
volumes:
|
volumes:
|
||||||
# - type: bind
|
|
||||||
# source: ./data/.env
|
|
||||||
# target: /usr/local/share/minetest.env
|
|
||||||
- ${PWD}/sample.env:/usr/local/share/minetest/.env
|
- ${PWD}/sample.env:/usr/local/share/minetest/.env
|
||||||
- ${PWD}/data/games:/usr/local/share/minetest/games
|
- ${PWD}/data/games:/usr/local/share/minetest/games
|
||||||
|
- ${PWD}/data/worlds:/usr/local/share/minetest/worlds
|
||||||
|
|
||||||
ports:
|
ports:
|
||||||
- "30000:30000/udp"
|
- "30000:30000/udp"
|
||||||
- "127.0.0.1:30000:30000/tcp"
|
- "127.0.0.1:30000:30000/tcp"
|
||||||
|
|
|
@ -9,4 +9,6 @@ echo $SERVER_ADMIN
|
||||||
#Set up admin name
|
#Set up admin name
|
||||||
echo "name = ${SERVER_ADMIN}" > /usr/local/share/minetest/minetest.conf
|
echo "name = ${SERVER_ADMIN}" > /usr/local/share/minetest/minetest.conf
|
||||||
|
|
||||||
/usr/local/bin/minetestserver --gameid $gameid --config /usr/local/share/minetest/minetest.conf
|
/usr/local/bin/minetestserver --gameid $gameid \
|
||||||
|
--config /usr/local/share/minetest/minetest.conf \
|
||||||
|
--world /usr/local/share/minetest/worlds/${WORLD_NAME}
|
|
@ -7,7 +7,7 @@ download_and_install_game() {
|
||||||
download_url=$(curl -X GET --silent "$API_URL/packages/${1}/" | jq ".url" | tr -d '"')
|
download_url=$(curl -X GET --silent "$API_URL/packages/${1}/" | jq ".url" | tr -d '"')
|
||||||
cd games || exit
|
cd games || exit
|
||||||
wget -O game.zip "${download_url}"
|
wget -O game.zip "${download_url}"
|
||||||
unzip -foqq game.zip
|
unzip -foq game.zip
|
||||||
rm game.zip
|
rm game.zip
|
||||||
cd ../ # data
|
cd ../ # data
|
||||||
}
|
}
|
||||||
|
@ -18,8 +18,8 @@ cd data || exit
|
||||||
calculated_dependencies=()
|
calculated_dependencies=()
|
||||||
|
|
||||||
#Checking for input
|
#Checking for input
|
||||||
if [[ $SERVER_MODS == "" || $SERVER_GAME == "" ]]; then
|
if [[ $SERVER_MODS == "" || $SERVER_GAME == "" || $WORLD_NAME == "" ]]; then
|
||||||
echo "Please, fill server.env file before launching this script!"
|
echo "Please, fill .env file before launching this script!"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -57,7 +57,7 @@ download_and_install_mod () {
|
||||||
mod_file="${mods_path}/mod.zip"
|
mod_file="${mods_path}/mod.zip"
|
||||||
echo "Writing to ${mod_file} content from url ${mod_url}"
|
echo "Writing to ${mod_file} content from url ${mod_url}"
|
||||||
wget -O "${mod_file}" "${mod_url}"
|
wget -O "${mod_file}" "${mod_url}"
|
||||||
unzip -foqq "${mod_file}" -d "${mods_path}"
|
unzip -foq "${mod_file}" -d "${mods_path}"
|
||||||
rm "${mod_file}"
|
rm "${mod_file}"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue