Can not add python lib to existing Docker image on Ubuntu server

  docker, python, ubuntu

Good day,
I’m trying to deploy Telegram bot on AWS Ubuntu server. But I can not run application because server says (when i run docker-compose up):

there is no name: asyncpg

However I installed it manually on server through

 pip3 install asyncpg 

and I checked later it is in the "packages" folder.

However, I sort of understand where problem is from. When I first tun

sudo docker-compose up

It used this file:

My Dockerfile:

FROM python:3.8

COPY requirements.txt /src
RUN pip install -r requirements.txt
COPY . /src

Where requirements.txt lacked this library. I edited requirements with


and tried to run:

docker-compose up 

again, but i again run into similar problem that

there is no asyncpg package

So as I understand docker-compose up uses already created image where there is no such package. I tried different solutions from SOF like build and > freeze but nothing helped. Probably because I dont quite understand what im doing, Im beginner at programming and python.

How can I add this package to existing docker image?

Source: Docker Questions