From: Guillaume Pellerin Date: Thu, 18 Apr 2024 07:53:09 +0000 (+0200) Subject: adapt Dockerfile to poetry, fix some versions X-Git-Tag: 2.9.0~15 X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=b0dc726ba48f80cd7edb119d8416c7f8087a55ed;p=teleforma.git adapt Dockerfile to poetry, fix some versions --- diff --git a/Dockerfile b/Dockerfile index 0ed62a73..c76b70d7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,7 +14,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -FROM python:3 +FROM python:3.9 MAINTAINER Guillaume Pellerin @@ -35,19 +35,33 @@ RUN apt-get update && \ locale-gen && \ apt-get clean -RUN pip3 install -U pip - ENV LANG fr_FR.UTF-8 ENV LANGUAGE fr_FR:fr ENV LC_ALL fr_FR.UTF-8 -COPY requirements.txt /srv -RUN pip3 install -r requirements.txt +# https://python-poetry.org/docs/configuration/#using-environment-variables +ENV POETRY_VERSION=1.4.2 \ + POETRY_NO_INTERACTION=1 \ + # make poetry install to this location + POETRY_HOME="/opt/poetry" \ + PIP_CACHE_DIR="/root/.cache/pip" + +ENV PATH="$POETRY_HOME/bin:$PATH" + +# # Install poetry - respects $POETRY_VERSION & $POETRY_HOME +RUN curl -sSL https://install.python-poetry.org | python - + +# upgrade pip and pin setuptools +# RUN pip3 install "setuptools<58.0.0" +RUN pip3 install -U pip +# RUN pip3 install setuptools==58 + +# Disable Poetry's virtualenv (useless in a container) +RUN poetry config virtualenvs.create false + +COPY poetry.lock pyproject.toml /srv/ -COPY requirements-dev.txt /srv -ARG dev=0 -RUN if [ "${dev}" = "1" ]; then pip3 install -r requirements-dev.txt; fi -RUN if [ "${dev}" = "1" ]; then apt-get -y install less nano postgresql-client redis-tools; fi +RUN --mount=type=cache,mode=0755,target=/root/.cache/pip poetry install --no-interaction COPY lib /srv/lib COPY bin/build/local/setup_lib.sh /srv diff --git a/debian-packages.txt b/debian-packages.txt index f80b5282..976a5429 100644 --- a/debian-packages.txt +++ b/debian-packages.txt @@ -2,9 +2,13 @@ git netcat vim locales -ipython +jupyter python3-setuptools python3-mysqldb python3-psycopg2 python3-yaml -uwsgi \ No newline at end of file +uwsgi +less +nano +postgresql-client +redis-tools diff --git a/poetry.lock b/poetry.lock index cfae683d..15d34593 100644 --- a/poetry.lock +++ b/poetry.lock @@ -601,14 +601,14 @@ files = [ [[package]] name = "django" -version = "3.2.23" +version = "3.2.25" description = "A high-level Python Web framework that encourages rapid development and clean, pragmatic design." category = "main" optional = false python-versions = ">=3.6" files = [ - {file = "Django-3.2.23-py3-none-any.whl", hash = "sha256:d48608d5f62f2c1e260986835db089fa3b79d6f58510881d316b8d88345ae6e1"}, - {file = "Django-3.2.23.tar.gz", hash = "sha256:82968f3640e29ef4a773af2c28448f5f7a08d001c6ac05b32d02aeee6509508b"}, + {file = "Django-3.2.25-py3-none-any.whl", hash = "sha256:a52ea7fcf280b16f7b739cec38fa6d3f8953a5456986944c3ca97e79882b4e38"}, + {file = "Django-3.2.25.tar.gz", hash = "sha256:7ca38a78654aee72378594d63e51636c04b8e28574f5505dff630895b5472777"}, ] [package.dependencies] @@ -2556,4 +2556,4 @@ testing = ["coverage (>=5.0.3)", "zope.event", "zope.testing"] [metadata] lock-version = "2.0" python-versions = "^3.11" -content-hash = "8c229218ad48da0aa4c65e8767bc64036aa1cd2bdff7fdcd754afd35ead48c83" +content-hash = "08360e2b240488c6754c0fa3dae558e0e53dc3e539c55f24f40c01143a084240" diff --git a/pyproject.toml b/pyproject.toml index 27690fe2..a82f28d5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -2,18 +2,18 @@ name = "teleforma" version = "2.8.0" description = "e-learning platform based on streaming" -authors = ["Guillaume Pellerin "] +authors = ["Guillaume Pellerin "] license = "CeCILL v2" readme = "README.md" [tool.poetry.dependencies] -python = "^3.11" +python = "^3.9" bigbluebutton-api-python = "0.0.11" channels = "3.0.4" channels-redis = "3.4.0" docutils = "0.17.1" daphne = "3.0.2" -django = "3.2.23" +django = "3.2.25" djangorestframework = "3.13.1" django-debug-toolbar = "3.2.1" dj-pagination = "2.5.0" @@ -25,7 +25,6 @@ django-tinymce = "3.3.0" django-unique-session = "1.0.0" django-user-agents = "0.4.0" django-recaptcha = "2.0.6" -ipython = "^8.23.0" jxmlease = "1.0.3" mysqlclient = "2.0.3" numpy = "1.26.4"