Optimize the size of the docker images, and reduce the time of the build
Also: check security aspects

Maybe see https://github.com/python-poetry/poetry/discussions/1879

Also, the code by @XciD in https://github.com/huggingface/datasets-preview-backend/tree/dockerize

```dockerfile
FROM python:3.9.6-bullseye

ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update \
    && apt-get upgrade -y \
    && apt-get install -y git-lfs \
    && rm -rf /var/lib/apt/lists/* \
    && git lfs install

WORKDIR /workspace/app

# Install poetry
RUN pip install --upgrade pip
RUN pip install poetry==1.1.12

# Copy the deps
COPY poetry.lock pyproject.toml ./
ADD vendors ./vendors
RUN poetry install --no-dev

# Copy the app
COPY ./src ./src
RUN poetry install

RUN useradd -m hf -u 1000
RUN chown hf:hf /workspace/app
ENV PATH /home/hf/.local/bin:$PATH
USER hf

# Launch the app
CMD ["poetry", "run", "python", "src/tensorboard_launcher/main.py"]
EXPOSE 8080
```
Optimize the size of the docker images, and reduce the time of the build: Also: check security aspects

Maybe see https://github.com/python-poetry/poetry/discussions/1879

Also, the code by @XciD in https://github.com/huggingface/datasets-preview-backend/tree/dockerize

```dockerfile
FROM python:3.9.6-bullseye

ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update \
    && apt-get upgrade -y \
    && apt-get install -y git-lfs \
    && rm -rf /var/lib/apt/lists/* \
    && git lfs install

WORKDIR /workspace/app

# Install poetry
RUN pip install --upgrade pip
RUN pip install poetry==1.1.12

# Copy the deps
COPY poetry.lock pyproject.toml ./
ADD vendors ./vendors
RUN poetry install --no-dev

# Copy the app
COPY ./src ./src
RUN poetry install

RUN useradd -m hf -u 1000
RUN chown hf:hf /workspace/app
ENV PATH /home/hf/.local/bin:$PATH
USER hf

# Launch the app
CMD ["poetry", "run", "python", "src/tensorboard_launcher/main.py"]
EXPOSE 8080
```