diff --git a/Dockerfile.moth-devel b/Dockerfile.moth-devel index 20c659a..6e8466a 100644 --- a/Dockerfile.moth-devel +++ b/Dockerfile.moth-devel @@ -16,6 +16,5 @@ COPY devel /app/ COPY example-puzzles /puzzles/ COPY theme /theme/ -WORKDIR /moth/ ENTRYPOINT [ "python3", "/app/devel-server.py" ] CMD [ "--bind", "0.0.0.0:8080", "--puzzles", "/puzzles", "--theme", "/theme" ] diff --git a/README.md b/README.md index 58f5d7d..9d9d9c9 100644 --- a/README.md +++ b/README.md @@ -23,8 +23,14 @@ and comes with a JavaScript-based scoreboard to display team rankings. Running a Development Server ============================ +To use example puzzles + docker run --rm -it -p 8080:8080 dirtbags/moth-devel +or, to use your own puzzles + + docker run --rm -it -p 8080:8080 -v /path/to/puzzles:/puzzles:ro dirtbags/moth-devel + And point a browser to http://localhost:8080/ (or whatever host is running the server). The development server includes a number of Python libraries that we have found useful in writing puzzles. diff --git a/devel/devel-server.py b/devel/devel-server.py index 1a6167d..37fda8c 100755 --- a/devel/devel-server.py +++ b/devel/devel-server.py @@ -43,7 +43,11 @@ class MothRequestHandler(http.server.SimpleHTTPRequestHandler): def __init__(self, request, client_address, server): self.directory = str(server.args["theme_dir"]) - super().__init__(request, client_address, server) + try: + super().__init__(request, client_address, server, directory=server.args["theme_dir"]) + except TypeError: + super().__init__(request, client_address, server) + # Backport from Python 3.7 def translate_path(self, path):