12345678910111213141516171819202122 |
- FROM sunpeek/poetry:py3.11-slim as requirements
- WORKDIR /src
- COPY ./pyproject.toml ./
- COPY ./poetry.lock ./
- RUN poetry export -f requirements.txt --without-hashes -o /src/requirements.txt
- FROM python:3.11 as builder
- # ... yourself commands
- COPY --from=requirements /src/requirements.txt .
- RUN pip install --user -r requirements.txt -i http://mirrors.cloud.aliyuncs.com/pypi/simple/ --trusted-host mirrors.cloud.aliyuncs.com
- FROM python:3.11-slim-bullseye
- COPY --from=builder /root/.local /root/.local
- COPY . /app
- # update PATH environment variable
- ENV PATH=/root/.local/bin:/root/.local:$PATH
- WORKDIR /app
- CMD ["python","-m","JobMain"]
- # ... yourself commands
|