Skip to content

Commit

Permalink
Merge pull request #31 from davewalker5/fix-docker-image
Browse files Browse the repository at this point in the history
Fix Docker image build
  • Loading branch information
davewalker5 authored Feb 5, 2022
2 parents 87dfae5 + 8a69069 commit f6d9bcb
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
10 changes: 5 additions & 5 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
FROM python:3.10-slim-bullseye AS runtime

COPY naturerecorderpy-1.0.18.0 /opt/naturerecorderpy-1.0.18.0
COPY naturerecorderpy-1.0.19.0 /opt/naturerecorderpy-1.0.19.0

WORKDIR /opt/naturerecorderpy-1.0.18.0
WORKDIR /opt/naturerecorderpy-1.0.19.0

RUN apt-get update -y
RUN pip install -r requirements.txt
RUN pip install nature_recorder-1.0.18-py3-none-any.whl
RUN pip install nature_recorder-1.0.19-py3-none-any.whl

ENV NATURE_RECORDER_DATA_FOLDER=/var/opt/naturerecorderpy-1.0.18.0
ENV NATURE_RECORDER_DB=/var/opt/naturerecorderpy-1.0.18.0/naturerecorder.db
ENV NATURE_RECORDER_DATA_FOLDER=/var/opt/naturerecorderpy-1.0.19.0
ENV NATURE_RECORDER_DB=/var/opt/naturerecorderpy-1.0.19.0/naturerecorder.db

ENTRYPOINT [ "python" ]
CMD [ "-m", "naturerec_web" ]
5 changes: 3 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def find_package_files(directory, remove_root):

setuptools.setup(
name="nature_recorder",
version="1.0.18",
version="1.0.19",
description="Wildlife sightings database",
packages=setuptools.find_packages("src"),
include_package_data=True,
Expand All @@ -43,9 +43,10 @@ def find_package_files(directory, remove_root):
"naturerec_web.jobs": ["templates/jobs/*.html"],
"naturerec_web.life_list": ["templates/life_list/*.html"],
"naturerec_web.locations": ["templates/locations/*.html"],
"naturerec_web.reports": ["templates/reports/*.html"],
"naturerec_web.sightings": ["templates/sightings/*.html"],
"naturerec_web.species": ["templates/species/*.html"],
"naturerec_web.status": ["templates/status/*.html"],
"naturerec_web.species_ratings": ["templates/species_ratings/*.html"],
"naturerec_web.status": ["templates/status/*.html"],
}
)
5 changes: 5 additions & 0 deletions src/naturerec_model/logic/reports.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,11 @@ def save_report_barchart(report_df, y_column_name, x_label, y_label, title, imag
# Save to the specified file in PNG format
plt.savefig(image_path, format='png', dpi=300)

# And clear the plot
plt.clf()
plt.cla()
plt.close()


def get_image_base64(image_path):
"""
Expand Down

0 comments on commit f6d9bcb

Please sign in to comment.