Category : python-poetry

I have a Django project and I’m trying to set it up with Docker. I use Poetry, so I have to install Poetry in the container. Below is my Dockerfile. FROM python:3.9.7-alpine WORKDIR /usr/src/app ENV PYTHONDONTWRITEBYTECODE 1 ENV PYTHONUNBUFFERED 1 # install curl because it does not exist on alpine RUN apk –no-cache add curl ..

Read more

I’m trying to dockerize a simple script (a command line utility). Here is a working Dockerfile: FROM python:3.9-slim ARG user=tweaker project=tex-tweak src=tex_tweak # Non-root user. RUN useradd -ms /bin/bash "$user" USER $user WORKDIR /home/$user ENV PATH=/home/$user/.local/bin:$PATH # Source and project files. RUN mkdir /home/$user/$project WORKDIR /home/$user/$project COPY $src ./$src/ COPY pyproject.toml ./ #COPY poetry.lock ./ ..

Read more

I’d like to dockerize an app that uses alembic and also allow docker to connect to a local postgres database. This is what I have so far: Dockerfile FROM python:3.8.6-slim AS base COPY requirements.txt . RUN pip install -r requirements.txt WORKDIR /src COPY . /src ENV PYTHONPATH="$PYTHONPATH:/src" COPY alembic/ ./alembic/ COPY pyproject.toml . COPY alembic.ini ..

Read more

Cannot spawn shell using poetry in docker container, got this error. > [ 9/10] RUN poetry shell: #14 1.153 Spawning shell within /root/.cache/pypoetry/virtualenvs/gmcrm-9TtSrW0h-py3.9 #14 2.137 #14 2.137 error #14 2.137 #14 2.137 (25, ‘Inappropriate ioctl for device’) #14 2.137 #14 2.139 at /usr/local/lib/python3.9/site-packages/pexpect/pty_spawn.py:788 in interact #14 2.198 784│ # Flush the buffer. #14 2.199 785│ ..

Read more

I have a Dockerfile like this: FROM python:3.9 WORKDIR /app RUN apt-get update && apt-get upgrade -y RUN curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/install-poetry.py | python – ENV PATH /root/.local/bin:$PATH COPY pyproject.toml poetry.lock Makefile ./ COPY src ./src COPY tests ./tests RUN poetry install && poetry run pytest && make clean CMD ["bash"] As you can see that ..

Read more

I get an issue where when docker-compose up the dependency often fails to install and an error message appears like this: this happens often, but sometimes it works These are the tool that I used: docker version 20.10.5 docker-compose version 1.28.6 Dockerfile : FROM python:3.8-slim as python-base # Setup ENV pyhton ENV PYTHONFAULTHANDLER=1 PYTHONUNBUFFERED=1 PYTHONHASHSEED=random ..

Read more