I’m having a bit of trouble with a local development workflow, when we’re building an app.
I’ve pasted the dockerfile and docker-compose.yml files we’re using below, and everything works as expected.
everything is running, I can see the site and make code alterations successfully
what I’m struggling with now is adding a python module to the Dockerfile, and get that change to take effect in my container.
the only way I’ve found so far, and I’m having some different sorts of results doing this, add the new module to requirements.txt, then bring everything down
then find the pcstudents_web image, and all it’s child images, delete them, then run
sometimes that works ok, sometimes I’m blowing away my data volume, sometimes it doesn’t work at all
I’m pretty certain it’s because of the order I’m doing things, and/or not going them correctly either probably
Am I going down the right track here, or is there a much easier way to accomplish what I’m trying to do, or am i just doing it all wrong?
any hints or tips or links, greatly appreciated
command: echo 'Data Container for PostgreSQL’
command: python manage.py runserver 0.0.0.0:8000 --settings=pcstudents.settings.dev
ENV PYTHONUNBUFFERED 1
RUN mkdir /code
ADD requirements.txt /code/
RUN pip install -r requirements.txt
ADD . /code/