evennia/Dockerfile

55 lines
1.7 KiB
Text
Raw Normal View History

#####
# Base docker image for running Evennia-based games in a container.
#
2017-10-20 00:25:33 +02:00
# Install:
# install `docker` (http://docker.com)
#
2017-10-20 00:25:33 +02:00
# Usage:
# cd to a folder where you want your game data to be (or where it already is).
#
2017-10-20 00:25:33 +02:00
# 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
2016-12-14 19:21:59 -06:00
2017-10-20 23:28:59 +02:00
MAINTAINER www.evennia.com
2016-12-14 19:21:59 -06:00
# install compilation environment
2017-10-20 00:25:33 +02:00
RUN apk update && apk add python py-pip python-dev py-setuptools gcc musl-dev jpeg-dev zlib-dev bash
2016-12-14 19:21:59 -06:00
# add the project source
ADD . /usr/src/evennia
2016-12-14 19:21:59 -06:00
# install dependencies
RUN pip install -e /usr/src/evennia --index-url=http://pypi.python.org/simple/ --trusted-host pypi.python.org
2016-12-14 19:21:59 -06:00
2017-10-20 23:10:08 +02:00
# add the game source when rebuilding a new docker image from inside
# a game dir
ONBUILD ADD . /usr/src/game
2016-12-14 19:21:59 -06:00
# make the game source hierarchy persistent with a named volume.
2017-10-20 23:10:08 +02:00
# mount on-disk game location here when using the container
# to just get an evennia environment.
VOLUME /usr/src/game
2016-12-14 19:21:59 -06:00
# set the working directory
2017-10-20 00:25:33 +02:00
WORKDIR /usr/src/game
2016-12-14 19:21:59 -06:00
2017-10-20 00:45:11 +02:00
# set bash prompt
2017-10-20 23:10:08 +02:00
ENV PS1 "evennia|docker \w $ "
2017-10-20 00:45:11 +02:00
2017-10-20 00:25:33 +02:00
# startup a shell when we start the container
ENTRYPOINT ["bash"]
2016-12-14 19:21:59 -06:00
# expose the telnet, webserver and websocket client ports
EXPOSE 4000 4001 4005