Update docker file to better handle starting without an existing game folder
This commit is contained in:
parent
fdc4550e19
commit
a2e8b27ee4
3 changed files with 22 additions and 7 deletions
12
Dockerfile
12
Dockerfile
|
|
@ -7,7 +7,7 @@
|
||||||
# Usage:
|
# Usage:
|
||||||
# cd to a folder where you want your game data to be (or where it already is).
|
# cd to a folder where you want your game data to be (or where it already is).
|
||||||
#
|
#
|
||||||
# docker run -it -p 4000:4000 -p 4001:4001 -p 4005:4005 -v $PWD:/usr/src/game evennia/evennia
|
# docker run -it --rm -p 4000:4000 -p 4001:4001 -p 4005:4005 -v $PWD:/usr/src/game evennia/evennia
|
||||||
#
|
#
|
||||||
# (If your OS does not support $PWD, replace it with the full path to your current
|
# (If your OS does not support $PWD, replace it with the full path to your current
|
||||||
# folder).
|
# folder).
|
||||||
|
|
@ -15,6 +15,14 @@
|
||||||
# You will end up in a shell where the `evennia` command is available. From here you
|
# You will end up in a shell where the `evennia` command is available. From here you
|
||||||
# can install and run the game normally. Use Ctrl-D to exit the evennia docker container.
|
# can install and run the game normally. Use Ctrl-D to exit the evennia docker container.
|
||||||
#
|
#
|
||||||
|
# You can also start evennia directly by passing arguments to the folder:
|
||||||
|
#
|
||||||
|
# docker run -it --rm -p 4000:4000 -p 4001:4001 -p 4005:4005 -v $PWD:/usr/src/game evennia/evennia evennia start -l
|
||||||
|
#
|
||||||
|
# This will start Evennia running as the core process of the container. Note that you *must* use -l
|
||||||
|
# or one of the foreground modes (like evennia ipstart) since otherwise the container will immediately
|
||||||
|
# die since no foreground process keeps it up.
|
||||||
|
#
|
||||||
# The evennia/evennia base image is found on DockerHub and can also be used
|
# The evennia/evennia base image is found on DockerHub and can also be used
|
||||||
# as a base for creating your own custom containerized Evennia game. For more
|
# as a base for creating your own custom containerized Evennia game. For more
|
||||||
# info, see https://github.com/evennia/evennia/wiki/Running%20Evennia%20in%20Docker .
|
# info, see https://github.com/evennia/evennia/wiki/Running%20Evennia%20in%20Docker .
|
||||||
|
|
@ -58,7 +66,7 @@ WORKDIR /usr/src/game
|
||||||
ENV PS1 "evennia|docker \w $ "
|
ENV PS1 "evennia|docker \w $ "
|
||||||
|
|
||||||
# startup a shell when we start the container
|
# startup a shell when we start the container
|
||||||
ENTRYPOINT bash -c "source /usr/src/evennia/bin/unix/evennia-docker-start.sh"
|
ENTRYPOINT ["/usr/src/evennia/bin/unix/evennia-docker-start.sh"]
|
||||||
|
|
||||||
# expose the telnet, webserver and websocket client ports
|
# expose the telnet, webserver and websocket client ports
|
||||||
EXPOSE 4000 4001 4005
|
EXPOSE 4000 4001 4005
|
||||||
|
|
|
||||||
16
bin/unix/evennia-docker-start.sh
Normal file → Executable file
16
bin/unix/evennia-docker-start.sh
Normal file → Executable file
|
|
@ -1,10 +1,18 @@
|
||||||
#! /bin/bash
|
#! /bin/sh
|
||||||
|
|
||||||
# called by the Dockerfile to start the server in docker mode
|
# called by the Dockerfile to start the server in docker mode
|
||||||
|
|
||||||
# remove leftover .pid files (such as from when dropping the container)
|
# remove leftover .pid files (such as from when dropping the container)
|
||||||
rm /usr/src/game/server/*.pid >& /dev/null || true
|
rm /usr/src/game/server/*.pid >& /dev/null || true
|
||||||
|
|
||||||
# start evennia server; log to server.log but also output to stdout so it can
|
PS1="evennia|docker \w $ "
|
||||||
# be viewed with docker-compose logs
|
|
||||||
exec 3>&1; evennia start -l
|
cmd="$@"
|
||||||
|
output="Docker starting with argument '$cmd' ..."
|
||||||
|
if test -z $cmd; then
|
||||||
|
cmd="bash"
|
||||||
|
output="No argument given, starting shell ..."
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo $output
|
||||||
|
exec 3>&1; $cmd
|
||||||
|
|
|
||||||
|
|
@ -258,7 +258,6 @@ def prototype_from_object(obj):
|
||||||
aliases = obj.aliases.get(return_list=True)
|
aliases = obj.aliases.get(return_list=True)
|
||||||
if aliases:
|
if aliases:
|
||||||
prot['aliases'] = aliases
|
prot['aliases'] = aliases
|
||||||
from evennia import set_trace;set_trace()
|
|
||||||
tags = [(tag.db_key, tag.db_category, tag.db_data)
|
tags = [(tag.db_key, tag.db_category, tag.db_data)
|
||||||
for tag in obj.tags.all(return_objs=True)]
|
for tag in obj.tags.all(return_objs=True)]
|
||||||
if tags:
|
if tags:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue