35 lines
602 B
Docker
35 lines
602 B
Docker
#
|
|
FROM python:3.10 as requirements-stage
|
|
|
|
#
|
|
WORKDIR /tmp
|
|
|
|
#
|
|
RUN pip install poetry
|
|
|
|
#
|
|
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.tuna.tsinghua.edu.cn/simple
|
|
|
|
#
|
|
COPY ./app /code/app
|
|
COPY ./alembic /code/alembic
|
|
COPY ./alembic.ini /code/alembic.ini
|
|
|
|
#
|
|
# CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "80"]
|