From 299e1c268f064e798a1aa19e038896caef1fa2db Mon Sep 17 00:00:00 2001 From: Eric Yvorchuk Date: Fri, 24 May 2024 14:49:22 -0700 Subject: [PATCH] Update Dockerfile --- Dockerfile | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/Dockerfile b/Dockerfile index 02f67ba..6c16756 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,25 +1,26 @@ -FROM python:3.8-slim +FROM python:3.11-slim LABEL Maintainer=https://github.com/pacificclimate/thunderbird Description="thunderbird WPS" Vendor="pcic" Version="1.2.3" ENV DEBIAN_FRONTEND=noninteractive ENV PIP_INDEX_URL="https://pypi.pacificclimate.org/simple/" COPY . /tmp +ADD poetry.lock /tmp +ADD pyproject.toml /tmp WORKDIR /tmp RUN apt-get update && \ - apt-get install -y build-essential cdo libhdf5-serial-dev netcdf-bin libnetcdf-dev && \ + apt-get install -y build-essential cdo curl libhdf5-serial-dev netcdf-bin libnetcdf-dev && \ rm -rf /var/lib/apt/lists/* && \ - # this line combats the issue found here: - # https://superuser.com/questions/1347723/arch-on-wsl-libqt5core-so-5-not-found-despite-being-installed - strip --remove-section=.note.ABI-tag /usr/lib/x86_64-linux-gnu/libQt5Core.so.5 && \ # Removing this package prevents a scan failure. It will be reintroduced # once 1.24.2 becomes available through the base image. # Issue link: https://github.com/advisories/GHSA-mh33-7rrq-662w - apt-get remove -y python3-urllib3 && \ - pip install -U pip && \ - pip install . && \ - pip install gunicorn + apt-get remove -y python3-urllib3 + +RUN curl -sSL https://install.python-poetry.org | python3 - +ENV PATH=/root/.local/bin:$PATH +RUN poetry install && \ + poetry add gunicorn EXPOSE 5000 -CMD ["gunicorn", "--bind=0.0.0.0:5000", "thunderbird.wsgi:application"] \ No newline at end of file +CMD ["poetry", "run", "gunicorn", "--bind=0.0.0.0:5000", "thunderbird.wsgi:application"]