From 816f92e48caf127c73bb5f662ab561edbe51c67e Mon Sep 17 00:00:00 2001 From: Dave Walker Date: Mon, 19 Aug 2024 11:47:14 +0100 Subject: [PATCH] Remove application version from mount point names in Docker container --- docker/Dockerfile | 10 +++---- docker/README.md | 69 ++++++++++++++++++++--------------------------- setup.py | 2 +- 3 files changed, 35 insertions(+), 46 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index 1d56e2e..f6db510 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,15 +1,15 @@ FROM python:3.10-slim-bullseye AS runtime -COPY naturerecorderpy-1.4.0.0 /opt/naturerecorderpy-1.4.0.0 +COPY naturerecorderpy-1.5.0.0 /opt/naturerecorderpy -WORKDIR /opt/naturerecorderpy-1.4.0.0 +WORKDIR /opt/naturerecorderpy RUN apt-get update -y RUN pip install -r requirements.txt -RUN pip install nature_recorder-1.4.0-py3-none-any.whl +RUN pip install nature_recorder-1.5.0-py3-none-any.whl -ENV NATURE_RECORDER_DATA_FOLDER=/var/opt/naturerecorderpy-1.4.0.0 -ENV NATURE_RECORDER_DB=/var/opt/naturerecorderpy-1.4.0.0/naturerecorder.db +ENV NATURE_RECORDER_DATA_FOLDER=/var/opt/naturerecorderpy +ENV NATURE_RECORDER_DB=/var/opt/naturerecorderpy/naturerecorder.db ENTRYPOINT [ "python" ] CMD [ "-m", "naturerec_web", "production" ] diff --git a/docker/README.md b/docker/README.md index b548fa4..9b41e33 100644 --- a/docker/README.md +++ b/docker/README.md @@ -5,25 +5,25 @@ The Nature Recorder is a personal widlife sightings logbook application implemen The application provides facilities for recording and querying the following data: - Locations, with the following details: - - Unique name - - Address details - - Latitude and longitude + - Unique name + - Address details + - Latitude and longitude - Categories, with the following details: - - Category name e.g. birds, mammals + - Category name e.g. birds, mammals - Species, with the following details: - - The category to which the species belongs - - Species name + - The category to which the species belongs + - Species name - Species sightings, consisting of: - - The species, and by implication the category the species belongs to - - Location - - Date - - Gender of the animals seen - - Number of animals seen (optional) - - Whether or not they were seen with young + - The species, and by implication the category the species belongs to + - Location + - Date + - Gender of the animals seen + - Number of animals seen (optional) + - Whether or not they were seen with young - Conservation status information, consisting of: - - Conservation schemes, acting as containers for a set of rating values - - Conservation status ratings, values for the conservation status within a scheme - - Species conservation status ratings, status ratings for a species with effective start and end dates + - Conservation schemes, acting as containers for a set of rating values + - Conservation status ratings, values for the conservation status within a scheme + - Species conservation status ratings, status ratings for a species with effective start and end dates The naturerecorderpy image contains a distribution of the application implementing a Flask-based web UI hosted on the Flask development server, for personal use only. @@ -33,9 +33,9 @@ The naturerecorderpy image contains a distribution of the application implementi In order to run this image you'll need docker installed. -* [Windows](https://docs.docker.com/windows/started) -* [OS X](https://docs.docker.com/mac/started/) -* [Linux](https://docs.docker.com/linux/started/) +- [Windows](https://docs.docker.com/windows/started) +- [OS X](https://docs.docker.com/mac/started/) +- [Linux](https://docs.docker.com/linux/started/) ### Usage @@ -43,17 +43,17 @@ In order to run this image you'll need docker installed. The following "docker run" parameters are recommended when running the naturerecorderpy image: -| Parameter | Value | Purpose | -| --- | --- | --- | -| -d | - | Run as a background process -| -v | /local:/var/opt/naturerecorderpy.api-1.0.21.0 | Mount the host folder containing the SQLite database | -| -p | 80:5000 | Expose the container's port 5000 as port 80 on the host | -| --rm | - | Remove the container automatically when it stops | +| Parameter | Value | Purpose | +| --------- | ------------------------------------ | ------------------------------------------------------- | +| -d | - | Run as a background process | +| -v | /local:/var/opt/naturerecorderpy.api | Mount the host folder containing the SQLite database | +| -p | 80:5000 | Expose the container's port 5000 as port 80 on the host | +| --rm | - | Remove the container automatically when it stops | For example: ```shell -docker run -d -v /local:/var/opt/naturerecorderpy-1.0.21.0/ -p 80:5000 --rm davewalker5/naturerecorderpy:latest +docker run -d -v /local:/var/opt/naturerecorderpy/ -p 80:5000 --rm davewalker5/naturerecorderpy:latest ``` The "/local" path given to the -v argument is described, below, and should be replaced with a value appropriate for the host running the container. Similarly, the port number "80" can be replaced with any available port on the host. @@ -69,7 +69,7 @@ That folder should contain a SQLite database named "naturerecorder.db", created To run the image, enter the following commands, substituting "/local" for the host folder containing the SQLite database, as described: ```shell -docker run -d -v /local:/var/opt/naturerecorderpy-1.0.21.0/ -p 80:5000 --rm davewalker5/naturerecorderpy:latest +docker run -d -v /local:/var/opt/naturerecorderpy/ -p 80:5000 --rm davewalker5/naturerecorderpy:latest ``` Once the container is running, browse to the following URL on the host: @@ -78,20 +78,9 @@ http://localhost:80 You should see the sightings entry page, with other data maintenance and reporting options in the menu bar at the top of the page. -## Built With - -The naturerecorderpy image was been built with the following: - -| Aspect | Version | -| --- | --- | -| Python | 3.10.0 | -| Docker Desktop | 20.10.11 | - -Other dependencies and their versions are listed in the project's [requirements.txt](https://github.com/davewalker5/NatureRecorderPy/blob/main/requirements.txt) file - ## Find Us -* [NatureRecorderPy on GitHub](https://github.com/davewalker5/NatureRecorderPy) +- [NatureRecorderPy on GitHub](https://github.com/davewalker5/NatureRecorderPy) ## Versioning @@ -99,9 +88,9 @@ For the versions available, see the [tags on this repository](https://github.com ## Authors -* **Dave Walker** - *Initial work* - [LinkedIn](https://www.linkedin.com/in/davewalker5/) +- **Dave Walker** - _Initial work_ - [LinkedIn](https://www.linkedin.com/in/davewalker5/) -See also the list of [contributors](https://github.com/davewalker5/NatureRecorderPy/contributors) who +See also the list of [contributors](https://github.com/davewalker5/NatureRecorderPy/contributors) who participated in this project. ## License diff --git a/setup.py b/setup.py index bf13599..6030835 100644 --- a/setup.py +++ b/setup.py @@ -31,7 +31,7 @@ def find_package_files(directory, remove_root): setuptools.setup( name="nature_recorder", - version="1.4.0", + version="1.5.0", description="Wildlife sightings database", packages=setuptools.find_packages("src"), include_package_data=True,