]> git.parisson.com Git - teleforma.git/commitdiff
adapt Dockerfile to poetry, fix some versions
authorGuillaume Pellerin <guillaume.pellerin@free.fr>
Thu, 18 Apr 2024 07:53:09 +0000 (09:53 +0200)
committerGuillaume Pellerin <guillaume.pellerin@free.fr>
Thu, 18 Apr 2024 07:53:09 +0000 (09:53 +0200)
Dockerfile
debian-packages.txt
poetry.lock
pyproject.toml

index 0ed62a73393399ab87211b089971fcffd659220c..c76b70d7db842c4c5a868b81ae4352249fde5567 100644 (file)
@@ -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 <yomguy@parisson.com>
 
@@ -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
index f80b528257546b46cbd94fe030b44c4f975b9ac6..976a5429abb7b3aa9f41243ec32b443d220bb473 100644 (file)
@@ -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
index cfae683d53b22017fcfa41934090262ef83b9966..15d3459354886cb4603c32d5040e7359fe0c6f6e 100644 (file)
@@ -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"
index 27690fe240fe0eaf7c310c8ab11f1e3439f5160e..a82f28d53a52bf5c9cdd309e69ee41c07449a71b 100644 (file)
@@ -2,18 +2,18 @@
 name = "teleforma"
 version = "2.8.0"
 description = "e-learning platform based on streaming"
-authors = ["Guillaume Pellerin <guillaume.pellerin@free.fr>"]
+authors = ["Guillaume Pellerin <guillaume.pellerin@parisson.com>"]
 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"