From 3ed7f079ed29c516c26b11324ed96e34f17825d6 Mon Sep 17 00:00:00 2001 From: Felipe Novaes F Rocha Date: Mon, 30 Oct 2023 04:22:27 -0300 Subject: [PATCH] :o: ml using requirements --- packages/ml/Dockerfile | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/packages/ml/Dockerfile b/packages/ml/Dockerfile index f23edb6..fbe2199 100644 --- a/packages/ml/Dockerfile +++ b/packages/ml/Dockerfile @@ -1,4 +1,4 @@ -FROM python:3.10-slim-bullseye AS base +FROM python:3.10-slim-bullseye AS prod ENV PYTHONFAULTHANDLER=1 \ PYTHONUNBUFFERED=1 \ @@ -9,16 +9,13 @@ RUN pip install -U pip setuptools wheel RUN pip install pdm # copy files -COPY pyproject.toml /project/ +COPY . /project/ -# install dependencies and project into the local packages directory WORKDIR /project -RUN pdm install - -FROM python:3.10-slim-bullseye as prod +RUN pdm lock +RUN pdm export --format requirements --without-hashes > requirements.txt -COPY . /project/ -WORKDIR /project/ +RUN pip install -r requirements.txt CMD ["python","src/api.py"] \ No newline at end of file