I have the following Dockerfile for a django app I am building
# base image to be used
FROM python:3.6
# The enviroment variable ensures that the python output is set straight
# to the terminal with out buffering it first
ENV PYTHONUNBUFFERED 1
# create root directory for our project in the container
#RUN mkdir /code
# Set the working directory to the created dir
WORKDIR /code
# add the requiremnets file to the working dir
COPY requirements.txt /code/
#instal the requirements (install before adding rest of code to avoid rerunning this at every code change-built in layers)
RUN pip3 install -r requirements.txt
# Copy the current directory contents into the container at /music_service
COPY . /code/
#set environments to be used
ENV AUTHOR="Mokgadi Rasekgala "
EXPOSE 8000
VOLUME /code
#run the service docker app
CMD /code/start.sh
when i build the file and run it using the following command
docker run -it -p 8000:8000 <image>
the volume does not seem to be mounted on /code directory
I also tried running it as
docker run -it -v my-vol:/code -p 8000:8000 <image>
but also still does not recognise changes i make to view without first building
As there something I am missing on how to define the Volume. I am trying to get the changes to be visible without having to build and run again