Skip to content

docker solution #2

@mastadev72

Description

@mastadev72

FROM python:3.9

WORKDIR /app

Install Poetry

RUN curl -sSL https://install.python-poetry.org | python3 -

RUN curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | POETRY_HOME=/opt/poetry python && \

RUN cd /usr/local/bin && ln -s /opt/poetry/bin/poetry && poetry config virtualenvs.create false

RUN pip3 install poetry
RUN poetry config virtualenvs.create false

RUN poetry install --no-dev

Copy using poetry.lock* in case it doesn't exist yet

COPY ./app/pyproject.toml ./app/poetry.lock* /app/

RUN poetry install --no-root --no-dev

COPY ./app /app

CMD ["uvicorn", "app.main:app", "--reload", "--host", "0.0.0.0", "--port", "80"]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions