From 3d17553411ceb1b643eff369c881c7c84dadb6ac Mon Sep 17 00:00:00 2001 From: HsiangNianian Date: Tue, 24 Sep 2024 21:30:06 +0800 Subject: [PATCH] feat(build): update base image and install python dependencies --- Dockerfile | 14 +++++++++----- Dockerfile.prod | 5 +++-- pyproject.toml | 2 +- 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/Dockerfile b/Dockerfile index 146faf8f..013a91b9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,16 +1,20 @@ -FROM rust:latest +FROM python:3.10 -USER root +LABEL maintainer="HsiangNianian " +LABEL org.opencontainers.image.description "A simple iamai examples with python 3.10" RUN apt-get update && \ - apt-get install -y python3-full + apt-get install -y curl && \ + curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y && \ + export PATH="$HOME/.cargo/bin:$PATH" WORKDIR /app COPY . . RUN python3 -m venv /.venv -RUN /.venv/bin/python -m pip install pdm maturin +RUN /.venv/bin/python -m pip install --upgrade pip && \ + /.venv/bin/python -m pip install pdm maturin RUN /.venv/bin/python -m pdm sync RUN /.venv/bin/python -m pdm install -dG dev -CMD ["pdm", "run", "iamai", "version"] \ No newline at end of file +CMD ["/.venv/bin/python", "-m", "pdm", "run", "iamai", "version"] \ No newline at end of file diff --git a/Dockerfile.prod b/Dockerfile.prod index 04d96f24..0426d78d 100644 --- a/Dockerfile.prod +++ b/Dockerfile.prod @@ -1,8 +1,9 @@ FROM python:3.10 WORKDIR /app -COPY . /examples -RUN pip install iamai +ADD /examples /app/ + +RUN pip install iamai[all] CMD ["pdm", "run", "main.py"] \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 3450489c..450f065e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -37,7 +37,7 @@ classifiers = [ ] requires-python = ">=3.9" dependencies = [ - "tomli>=2.0.0、", + "tomli>=2.0.0", "pydantic>=2.0.3,<3.0.0", "aiohttp>=3.9.1", "loguru>=0.7.0,<0.8.0",