2017-01-24 15:19:41 -06:00
|
|
|
#####
|
|
|
|
|
# Base docker image for running Evennia-based games in a container.
|
|
|
|
|
#
|
2017-10-20 00:25:33 +02:00
|
|
|
# Install:
|
2021-06-23 20:05:25 +12:00
|
|
|
# install `docker` (https://docker.com)
|
2017-07-21 13:40:48 +02:00
|
|
|
#
|
2017-10-20 00:25:33 +02:00
|
|
|
# Usage:
|
2017-12-09 01:13:02 +01:00
|
|
|
# cd to a folder where you want your game data to be (or where it already is).
|
2017-01-24 15:19:41 -06:00
|
|
|
#
|
2019-04-22 12:30:17 +12:00
|
|
|
# docker run -it --rm -p 4000:4000 -p 4001:4001 -p 4002:4002 -v $PWD:/usr/src/game evennia/evennia
|
2017-12-09 01:13:02 +01:00
|
|
|
#
|
|
|
|
|
# (If your OS does not support $PWD, replace it with the full path to your current
|
2017-10-20 00:25:33 +02:00
|
|
|
# folder).
|
|
|
|
|
#
|
|
|
|
|
# You will end up in a shell where the `evennia` command is available. From here you
|
2019-10-01 11:29:47 +02:00
|
|
|
# can initialize and/or run the game normally. Use Ctrl-D to exit the evennia docker container.
|
2019-10-01 00:18:37 -07:00
|
|
|
# For more info see: https://github.com/evennia/evennia/wiki/Getting-Started#quick-start
|
2017-10-20 00:25:33 +02:00
|
|
|
#
|
2018-10-07 18:29:25 +02:00
|
|
|
# You can also start evennia directly by passing arguments to the folder:
|
2019-04-22 12:30:17 +12:00
|
|
|
#
|
|
|
|
|
# docker run -it --rm -p 4000:4000 -p 4001:4001 -p 4002:4002 -v $PWD:/usr/src/game evennia/evennia evennia start -l
|
2018-10-07 18:29:25 +02:00
|
|
|
#
|
|
|
|
|
# This will start Evennia running as the core process of the container. Note that you *must* use -l
|
2019-10-01 11:29:47 +02:00
|
|
|
# or one of the foreground modes (like evennia ipstart), since otherwise the container will immediately
|
|
|
|
|
# die because of having no foreground process.
|
2018-10-07 18:29:25 +02:00
|
|
|
#
|
2017-10-20 00:25:33 +02:00
|
|
|
# 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
|
2022-02-05 18:27:18 +01:00
|
|
|
# info, see https://evennia.com/docs/latest/Setup/Installation-Docker
|
2017-01-24 15:19:41 -06:00
|
|
|
#
|
2022-02-05 18:27:18 +01:00
|
|
|
FROM python:3.10-alpine
|
2016-12-14 19:21:59 -06:00
|
|
|
|
2018-07-31 12:24:45 -07:00
|
|
|
LABEL maintainer="www.evennia.com"
|
2017-10-20 23:28:59 +02:00
|
|
|
|
2016-12-14 19:21:59 -06:00
|
|
|
# install compilation environment
|
2019-04-04 19:11:24 +13:00
|
|
|
RUN apk update && apk add bash gcc jpeg-dev musl-dev procps \
|
|
|
|
|
libffi-dev openssl-dev zlib-dev gettext
|
2016-12-14 19:21:59 -06:00
|
|
|
|
2018-07-31 12:24:45 -07:00
|
|
|
# add the files required for pip installation
|
|
|
|
|
COPY ./setup.py /usr/src/evennia/
|
|
|
|
|
COPY ./requirements.txt /usr/src/evennia/
|
|
|
|
|
COPY ./evennia/VERSION.txt /usr/src/evennia/evennia/
|
|
|
|
|
COPY ./bin /usr/src/evennia/bin/
|
2016-12-14 19:21:59 -06:00
|
|
|
|
|
|
|
|
# install dependencies
|
2018-07-31 11:50:05 +02:00
|
|
|
RUN pip install --upgrade pip && pip install -e /usr/src/evennia --trusted-host pypi.python.org
|
2018-07-23 07:12:47 -04:00
|
|
|
RUN pip install cryptography pyasn1 service_identity
|
2016-12-14 19:21:59 -06:00
|
|
|
|
2018-07-31 12:24:45 -07:00
|
|
|
# add the project source; this should always be done after all
|
|
|
|
|
# expensive operations have completed to avoid prematurely
|
|
|
|
|
# invalidating the build cache.
|
|
|
|
|
COPY . /usr/src/evennia
|
|
|
|
|
|
2017-10-20 23:10:08 +02:00
|
|
|
# add the game source when rebuilding a new docker image from inside
|
2017-12-09 01:13:02 +01:00
|
|
|
# a game dir
|
2018-07-31 12:24:45 -07:00
|
|
|
ONBUILD COPY . /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.
|
2016-12-14 09:17:28 -06:00
|
|
|
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
|
|
|
|
2019-10-01 00:19:01 -07:00
|
|
|
# create and switch to a non-root user for runtime security
|
|
|
|
|
# -D - do not set a password
|
|
|
|
|
# -H - do not create a home directory
|
|
|
|
|
# -s /bin/false - set login shell to /bin/false
|
|
|
|
|
RUN adduser -D -H -s /bin/false evennia
|
|
|
|
|
USER evennia
|
|
|
|
|
|
2017-10-20 00:25:33 +02:00
|
|
|
# startup a shell when we start the container
|
2018-10-07 18:29:25 +02:00
|
|
|
ENTRYPOINT ["/usr/src/evennia/bin/unix/evennia-docker-start.sh"]
|
2016-12-14 19:21:59 -06:00
|
|
|
|
2017-07-21 13:40:48 +02:00
|
|
|
# expose the telnet, webserver and websocket client ports
|
2019-04-22 12:30:17 +12:00
|
|
|
EXPOSE 4000 4001 4002
|