Dockerfile 666 B

12345678910111213141516171819202122
  1. FROM sunpeek/poetry:py3.11-slim as requirements
  2. WORKDIR /src
  3. COPY ./pyproject.toml ./
  4. COPY ./poetry.lock ./
  5. RUN poetry export -f requirements.txt --without-hashes -o /src/requirements.txt
  6. FROM python:3.11 as builder
  7. # ... yourself commands
  8. COPY --from=requirements /src/requirements.txt .
  9. RUN pip install --user -r requirements.txt -i http://mirrors.cloud.aliyuncs.com/pypi/simple/ --trusted-host mirrors.cloud.aliyuncs.com
  10. FROM python:3.11-slim-bullseye
  11. COPY --from=builder /root/.local /root/.local
  12. COPY . /app
  13. # update PATH environment variable
  14. ENV PATH=/root/.local/bin:/root/.local:$PATH
  15. WORKDIR /app
  16. CMD ["python","-m","JobMain"]
  17. # ... yourself commands