diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..a06474f --- /dev/null +++ b/.dockerignore @@ -0,0 +1,7 @@ +/.venv +__pycache__ +*.pyc +/config.yml +/cache/ +.git +.gitignore \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..3946a0c --- /dev/null +++ b/Dockerfile @@ -0,0 +1,8 @@ +FROM python:3.13-slim + +WORKDIR /app +COPY . . +RUN pip install --no-cache-dir -r requirements.txt +EXPOSE 8080 + +CMD ["python3", "spothole.py"] \ No newline at end of file diff --git a/README.md b/README.md index 429f90a..ed4b113 100644 --- a/README.md +++ b/README.md @@ -173,6 +173,33 @@ http://localhost:8080` in the log, your server is good to go. If you see some errors on startup, check your configuration, e.g. in case you have specified a port for the web server that is already in use by something else. +### Running using Docker + +Spothole comes with a Docker configuration to make it easy to run it in a containerised environment. To set it up using +Docker, the easiest way is to use a Docker Compose file. Create a new directory such as `/opt/docker/spothole` and +create a `compose.yaml` file inside it with the following contents: + +```yaml +services: + spothole: + container_name: spothole + build: + context: https://git.ianrenton.com/ian/spothole.git#main + restart: unless-stopped + ports: + - "8080:8080" + volumes: + - ./config.yml:/app/config.yml + - ./cache:/app/cache +``` + +Save the file. You will still need to create a copy of `config-example.yml` and name it `config.yml`, though with the +Docker setup nothing has actually been downloaded yet, so you will have to copy the example from the repository some +other way, e.g. [from the repo in a web browser](https://git.ianrenton.com/ian/spothole/src/branch/main/config-example.yml). + +With that in place, run `docker compose up` and you should be good to go. To detach, press `d` or run the command with +the `-d` flag. + ### Multiple cluster nodes with different settings Dan, S50U has written in with his Spothole cluster settings. He is using a cluster node which provides RBN spots, and diff --git a/templates/add_spot.html b/templates/add_spot.html index 540222d..d86da0d 100644 --- a/templates/add_spot.html +++ b/templates/add_spot.html @@ -76,7 +76,7 @@ - + diff --git a/templates/alerts.html b/templates/alerts.html index ede5a6c..db8158e 100644 --- a/templates/alerts.html +++ b/templates/alerts.html @@ -82,7 +82,7 @@ - + diff --git a/templates/bands.html b/templates/bands.html index d7b0857..413ee0c 100644 --- a/templates/bands.html +++ b/templates/bands.html @@ -82,8 +82,8 @@ - - + + diff --git a/templates/base.html b/templates/base.html index 288c228..5a87751 100644 --- a/templates/base.html +++ b/templates/base.html @@ -1,6 +1,6 @@ {% extends "skeleton.html" %} {% block head_extra %} - + @@ -10,10 +10,10 @@ - - - - + + + + {% end %} {% block body %}