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..dace743 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,8 @@ +FROM python:3.11-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 6945ec6..d1b7864 100644 --- a/README.md +++ b/README.md @@ -172,6 +172,35 @@ countries. This is normal, don't panic! 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). + +You will also need to create the `cache` subdirectory manually, as Spothole cannot create it itself when running in the +container. + +With that in place, run `docker compose up -d` and you should be good to go. + ### 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 7322692..dec520a 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 433a78a..5e39abc 100644 --- a/templates/alerts.html +++ b/templates/alerts.html @@ -75,7 +75,7 @@ - + diff --git a/templates/bands.html b/templates/bands.html index 8292043..216bc30 100644 --- a/templates/bands.html +++ b/templates/bands.html @@ -75,8 +75,8 @@ - - + + diff --git a/templates/base.html b/templates/base.html index fff84e8..3e6122e 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 %}