From 1b6de483572054914711dec38a8b554fde8fc5d5 Mon Sep 17 00:00:00 2001 From: aarizona Date: Thu, 2 May 2024 13:33:55 +0300 Subject: [PATCH] base docker --- Dockerfile | 25 +++++++++++++++++++++++++ compose.yml | 0 2 files changed, 25 insertions(+) create mode 100644 Dockerfile create mode 100644 compose.yml diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..7d33eb9 --- /dev/null +++ b/Dockerfile @@ -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" ] \ No newline at end of file diff --git a/compose.yml b/compose.yml new file mode 100644 index 0000000..e69de29