Skip to content

Commit

Permalink
feat(build): update base image and install python dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
HsiangNianian committed Sep 24, 2024
1 parent bb3da6f commit 3d17553
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
14 changes: 9 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
FROM rust:latest
FROM python:3.10

USER root
LABEL maintainer="HsiangNianian <[email protected]>"
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"]
CMD ["/.venv/bin/python", "-m", "pdm", "run", "iamai", "version"]
5 changes: 3 additions & 2 deletions Dockerfile.prod
Original file line number Diff line number Diff line change
@@ -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"]
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 3d17553

Please sign in to comment.