From f845b3c8af2e3a80d987ad5705351a0297698a81 Mon Sep 17 00:00:00 2001 From: geoffrey stoel Date: Thu, 5 Oct 2017 00:27:21 +0200 Subject: [PATCH 1/6] Updated dockerfile to clean alpine image and add python + required libs to make work again. Fixed requirements.txt to fixed twisted version --- Dockerfile | 17 +++++++++++------ requirements.txt | 2 +- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/Dockerfile b/Dockerfile index 3527d3c8ac..f0f68e8818 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,17 +10,16 @@ # # https://github.com/evennia/evennia/wiki/Running%20Evennia%20in%20Docker # -FROM python:2.7-alpine -MAINTAINER Dan Feeney "feend78@gmail.com" +FROM alpine # install compilation environment -RUN apk update && apk add gcc musl-dev +RUN apk update && apk add python py-pip python-dev py-setuptools gcc musl-dev jpeg-dev zlib-dev # add the project source ADD . /usr/src/evennia # install dependencies -RUN pip install -e /usr/src/evennia +RUN pip install -e /usr/src/evennia --index-url=http://pypi.python.org/simple/ --trusted-host pypi.python.org # add the game source during game builds ONBUILD ADD . /usr/src/game @@ -31,10 +30,16 @@ ONBUILD ADD . /usr/src/game VOLUME /usr/src/game # set the working directory -WORKDIR /usr/src/game +WORKDIR /usr/src + +# init evennia +RUN evennia --init mygame + +WORKDIR /usr/src/mygame +RUN evennia migrate # startup command -CMD ["evennia", "-i", "start"] +# ENTRYPOINT ["evennia", "start"] # expose the telnet, webserver and websocket client ports EXPOSE 4000 4001 4005 diff --git a/requirements.txt b/requirements.txt index 4d007d9532..be3cf558e5 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,7 +1,7 @@ # Evennia dependencies, for Linux/Mac platforms django > 1.10, < 2.0 -twisted >= 16.0.0 +twisted == 16.0.0 mock >= 1.0.1 pillow == 2.9.0 pytz From 6871567d78ec1594f85c75308f8c23fb23c034d4 Mon Sep 17 00:00:00 2001 From: Griatch Date: Fri, 20 Oct 2017 00:25:33 +0200 Subject: [PATCH 2/6] Made alternative docker image style --- Dockerfile | 35 +++++++++++++++++++---------------- 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/Dockerfile b/Dockerfile index f0f68e8818..cd6c720b80 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,19 +1,28 @@ ##### # Base docker image for running Evennia-based games in a container. # -# This Dockerfile creates the evennia/evennia docker image -# on DockerHub, which can be used as the basis for creating -# an Evennia game within a container. This base image can be -# found in DockerHub at https://hub.docker.com/r/evennia/evennia/ +# Install: +# install `docker` (http://docker.com) # -# For more information on using it to build a container to run your game, see +# Usage: +# cd to a folder where you want your game data to be (or where it already is). # -# https://github.com/evennia/evennia/wiki/Running%20Evennia%20in%20Docker +# docker run -it -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 +# folder). +# +# 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. +# +# 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 +# info, see https://github.com/evennia/evennia/wiki/Running%20Evennia%20in%20Docker . # FROM alpine # install compilation environment -RUN apk update && apk add python py-pip python-dev py-setuptools gcc musl-dev jpeg-dev zlib-dev +RUN apk update && apk add python py-pip python-dev py-setuptools gcc musl-dev jpeg-dev zlib-dev bash # add the project source ADD . /usr/src/evennia @@ -30,16 +39,10 @@ ONBUILD ADD . /usr/src/game VOLUME /usr/src/game # set the working directory -WORKDIR /usr/src +WORKDIR /usr/src/game -# init evennia -RUN evennia --init mygame - -WORKDIR /usr/src/mygame -RUN evennia migrate - -# startup command -# ENTRYPOINT ["evennia", "start"] +# startup a shell when we start the container +ENTRYPOINT ["bash"] # expose the telnet, webserver and websocket client ports EXPOSE 4000 4001 4005 From 1729611529ec25e16f83e51438b7fbb6c2bde80b Mon Sep 17 00:00:00 2001 From: Griatch Date: Fri, 20 Oct 2017 00:45:11 +0200 Subject: [PATCH 3/6] Add custom prompt for docker container --- Dockerfile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Dockerfile b/Dockerfile index cd6c720b80..6c60946c61 100644 --- a/Dockerfile +++ b/Dockerfile @@ -41,6 +41,9 @@ VOLUME /usr/src/game # set the working directory WORKDIR /usr/src/game +# set bash prompt +ENV PS1 "evennia docker $ " + # startup a shell when we start the container ENTRYPOINT ["bash"] From 329bb28d9ee8b305f717d4274e6e6215a4d95bff Mon Sep 17 00:00:00 2001 From: Griatch Date: Fri, 20 Oct 2017 23:10:08 +0200 Subject: [PATCH 4/6] Some more docs --- Dockerfile | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 6c60946c61..6ef9b16650 100644 --- a/Dockerfile +++ b/Dockerfile @@ -30,19 +30,20 @@ ADD . /usr/src/evennia # install dependencies RUN pip install -e /usr/src/evennia --index-url=http://pypi.python.org/simple/ --trusted-host pypi.python.org -# add the game source during game builds +# add the game source when rebuilding a new docker image from inside +# a game dir ONBUILD ADD . /usr/src/game # make the game source hierarchy persistent with a named volume. -# during development this is typically superceded by directives in -# docker-compose.yml or the CLI to mount a local directory. +# mount on-disk game location here when using the container +# to just get an evennia environment. VOLUME /usr/src/game # set the working directory WORKDIR /usr/src/game # set bash prompt -ENV PS1 "evennia docker $ " +ENV PS1 "evennia|docker \w $ " # startup a shell when we start the container ENTRYPOINT ["bash"] From 4a282b859e80a3315a0265091110dfe47ceec936 Mon Sep 17 00:00:00 2001 From: Griatch Date: Fri, 20 Oct 2017 23:28:59 +0200 Subject: [PATCH 5/6] Change maintainer to be more generic --- Dockerfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Dockerfile b/Dockerfile index 6ef9b16650..c231f2a733 100644 --- a/Dockerfile +++ b/Dockerfile @@ -21,6 +21,8 @@ # FROM alpine +MAINTAINER www.evennia.com + # install compilation environment RUN apk update && apk add python py-pip python-dev py-setuptools gcc musl-dev jpeg-dev zlib-dev bash From 781de86777dfb8e8cfdf023e8663f41297360fc0 Mon Sep 17 00:00:00 2001 From: Nicholas Matlaga Date: Sun, 22 Oct 2017 15:34:13 -0400 Subject: [PATCH 6/6] Change aliases of ExtendedRoom's desc command to reflect 0.7 hanges' --- evennia/contrib/extended_room.py | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/evennia/contrib/extended_room.py b/evennia/contrib/extended_room.py index 962578fa11..6823ede50e 100644 --- a/evennia/contrib/extended_room.py +++ b/evennia/contrib/extended_room.py @@ -4,7 +4,7 @@ Extended Room Evennia Contribution - Griatch 2012 This is an extended Room typeclass for Evennia. It is supported -by an extended `Look` command and an extended `@desc` command, also +by an extended `Look` command and an extended `desc` command, also in this module. @@ -21,7 +21,7 @@ There is also a general description which is used as fallback if one or more of the seasonal descriptions are not set when their time comes. -An updated `@desc` command allows for setting seasonal descriptions. +An updated `desc` command allows for setting seasonal descriptions. The room uses the `evennia.utils.gametime.GameTime` global script. This is started by default, but if you have deactivated it, you need to @@ -45,13 +45,13 @@ at, without there having to be a database object created for it. The Details are simply stored in a dictionary on the room and if the look command cannot find an object match for a `look ` command it will also look through the available details at the current location -if applicable. An extended `@desc` command is used to set details. +if applicable. An extended `desc` command is used to set details. 4) Extra commands CmdExtendedLook - look command supporting room details - CmdExtendedDesc - @desc command allowing to add seasonal descs and details, + CmdExtendedDesc - desc command allowing to add seasonal descs and details, as well as listing them CmdGameTime - A simple `time` command, displaying the current time and season. @@ -63,7 +63,7 @@ Installation/testing: (see Wiki for how to do this). 2) `@dig` a room of type `contrib.extended_room.ExtendedRoom` (or make it the default room type) -3) Use `@desc` and `@detail` to customize the room, then play around! +3) Use `desc` and `detail` to customize the room, then play around! """ from __future__ import division @@ -333,26 +333,26 @@ class CmdExtendedLook(default_cmds.CmdLook): class CmdExtendedDesc(default_cmds.CmdDesc): """ - `@desc` - describe an object or room. + `desc` - describe an object or room. Usage: - @desc[/switch] [ =] - @detail[/del] [ = ] + desc[/switch] [ =] + detail[/del] [ = ] - Switches for `@desc`: + Switches for `desc`: spring - set description for in current room. summer autumn winter - Switch for `@detail`: + Switch for `detail`: del - delete a named detail. Sets the "desc" attribute on an object. If an object is not given, describe the current room. - The alias `@detail` allows to assign a "detail" (a non-object + The alias `detail` allows to assign a "detail" (a non-object target for the `look` command) to the current room (only). You can also embed special time markers in your room description, like this: @@ -364,11 +364,11 @@ class CmdExtendedDesc(default_cmds.CmdDesc): Text marked this way will only display when the server is truly at the given timeslot. The available times are night, morning, afternoon and evening. - Note that `@detail`, seasons and time-of-day slots only work on rooms in this - version of the `@desc` command. + Note that `detail`, seasons and time-of-day slots only work on rooms in this + version of the `desc` command. """ - aliases = ["@describe", "@detail"] + aliases = ["describe", "detail"] def reset_times(self, obj): """By deleteting the caches we force a re-load.""" @@ -416,7 +416,7 @@ class CmdExtendedDesc(default_cmds.CmdDesc): self.reset_times(location) return else: - # we are doing a @desc call + # we are doing a desc call if not self.args: if location: string = "|wDescriptions on %s|n:\n" % location.key