34 lines
533 B
Docker
34 lines
533 B
Docker
#
|
|
FROM python:3.10 as requirements-stage
|
|
|
|
#
|
|
WORKDIR /tmp
|
|
|
|
#
|
|
RUN pip install poetry -i https://pypi.douban.com/simple
|
|
|
|
#
|
|
COPY ./pyproject.toml ./poetry.lock* /tmp/
|
|
|
|
#
|
|
RUN poetry export -f requirements.txt --output requirements.txt --without-hashes
|
|
|
|
#
|
|
FROM python:3.10
|
|
|
|
#
|
|
WORKDIR /code
|
|
|
|
#
|
|
COPY --from=requirements-stage /tmp/requirements.txt /code/requirements.txt
|
|
|
|
#
|
|
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt -i https://pypi.douban.com/simple
|
|
|
|
#
|
|
COPY ./app /code/app
|
|
|
|
|
|
#
|
|
# CMD ["python", "/code/app/demo.py"]
|