Skip to content

Commit 3d17553

Browse files
committed
feat(build): update base image and install python dependencies
1 parent bb3da6f commit 3d17553

File tree

3 files changed

+13
-8
lines changed

3 files changed

+13
-8
lines changed

Dockerfile

+9-5
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,20 @@
1-
FROM rust:latest
1+
FROM python:3.10
22

3-
USER root
3+
LABEL maintainer="HsiangNianian <i@jyunko.cn>"
4+
LABEL org.opencontainers.image.description "A simple iamai examples with python 3.10"
45

56
RUN apt-get update && \
6-
apt-get install -y python3-full
7+
apt-get install -y curl && \
8+
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y && \
9+
export PATH="$HOME/.cargo/bin:$PATH"
710

811
WORKDIR /app
912
COPY . .
1013

1114
RUN python3 -m venv /.venv
12-
RUN /.venv/bin/python -m pip install pdm maturin
15+
RUN /.venv/bin/python -m pip install --upgrade pip && \
16+
/.venv/bin/python -m pip install pdm maturin
1317
RUN /.venv/bin/python -m pdm sync
1418
RUN /.venv/bin/python -m pdm install -dG dev
1519

16-
CMD ["pdm", "run", "iamai", "version"]
20+
CMD ["/.venv/bin/python", "-m", "pdm", "run", "iamai", "version"]

Dockerfile.prod

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
FROM python:3.10
22

33
WORKDIR /app
4-
COPY . /examples
54

6-
RUN pip install iamai
5+
ADD /examples /app/
6+
7+
RUN pip install iamai[all]
78

89
CMD ["pdm", "run", "main.py"]

pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ classifiers = [
3737
]
3838
requires-python = ">=3.9"
3939
dependencies = [
40-
"tomli>=2.0.0",
40+
"tomli>=2.0.0",
4141
"pydantic>=2.0.3,<3.0.0",
4242
"aiohttp>=3.9.1",
4343
"loguru>=0.7.0,<0.8.0",

0 commit comments

Comments
 (0)