Heroku container:push always re-installs conda packages

I’ve followed the python-miniconda tutorial offered by Heroku in order to create my own ML server on Python, which utilizes Anaconda and its packages.

Everything seems to be in order, however each time I wish to update the scripts located at /webapp by entering

  • Is there an easy way to change to a non-root user in Bitbucket Pipelines Docker container?
  • Building common dependencies with docker-compose
  • How to implement my project with docker and git
  • Symlink to volume in Docker container
  • Unable to connect to containers of a swarm in docker-in-docker
  • Docker: Unable to connect to container from host
  • heroku container:push
    

    A complete re-installation of the pip (or rather, Conda) dependencies is performed, which takes quite some time and seems illogical to me. My understanding of both Docker and Heroku frameworks is very shaky, so I haven’t been able to find a solution which allows me to push ONLY my code while leaving the container as is without (re?)uploading an entire image.

    Dockerfile:

    FROM heroku/miniconda
    
    ADD ./webapp/requirements.txt /tmp/requirements.txt
    
    RUN pip install -qr /tmp/requirements.txt
    
    ADD ./webapp /opt/webapp/ 
    WORKDIR /opt/webapp
    
    RUN conda install scikit-learn  
    RUN conda install opencv
    
    CMD gunicorn --bind 0.0.0.0:$PORT wsgi
    

  • Re-build Go (App Engine) app running inside docker container?
  • Private docker registry authentication in aws ecs optimized AMI is not successful
  • Secure server with Fail2ban and Docker
  • Powershell devbox Magento installation using Docker
  • Docker Remote API does not list containers
  • Docker - Updating Environment Variables of a Container
  • Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.