base docker
This commit is contained in:
parent
bf5ed0846a
commit
1b6de48357
|
@ -0,0 +1,25 @@
|
||||||
|
FROM python:3.10
|
||||||
|
|
||||||
|
# Configure Poetry
|
||||||
|
ENV POETRY_VERSION=1.2.0
|
||||||
|
ENV POETRY_HOME=/opt/poetry
|
||||||
|
ENV POETRY_VENV=/opt/poetry-venv
|
||||||
|
ENV POETRY_CACHE_DIR=/opt/.cache
|
||||||
|
|
||||||
|
# Install poetry separated from system interpreter
|
||||||
|
RUN python3 -m venv $POETRY_VENV \
|
||||||
|
&& $POETRY_VENV/bin/pip install -U pip setuptools \
|
||||||
|
&& $POETRY_VENV/bin/pip install poetry==${POETRY_VERSION}
|
||||||
|
|
||||||
|
# Add `poetry` to PATH
|
||||||
|
ENV PATH="${PATH}:${POETRY_VENV}/bin"
|
||||||
|
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
# Install dependencies
|
||||||
|
COPY poetry.lock pyproject.toml ./
|
||||||
|
RUN poetry install
|
||||||
|
|
||||||
|
# Run your app
|
||||||
|
COPY . /app
|
||||||
|
CMD [ "poetry", "run", "python", "uvicorn app.main:app --reload" ]
|
Loading…
Reference in New Issue