docker / awesome-compose

Awesome Docker Compose samples
https://docs.docker.com/compose/
Creative Commons Zero v1.0 Universal
34.57k stars 6.64k forks source link

Official docs - Django - superfluous commands? #333

Open SwampFalc opened 1 year ago

SwampFalc commented 1 year ago

Hello,

Being quite new to Docker, I would like to ask about something that appears to be superfluous to me in the official Django docs.

The last line of the Dockerfile is: COPY . /code/

But in the docker-compose.yml file, we have this statement:

    volumes:
      - .:/code

Is the first part not superfluous if the second part exists? Does it not simply make the image larger, without serving a purpose since the content of the folder gets overwritten by the mount anyway?

Or am I missing something?

aleon1220 commented 11 months ago

did you try to test it by removing the COPY instruction?