Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify docker image #6519

Merged
merged 1 commit into from
Jan 22, 2020
Merged

Conversation

stsewd
Copy link
Member

@stsewd stsewd commented Jan 13, 2020

  • We don't need all those files in the context
  • WORKDIR creates all missing directories

Also, since we are not using this image for deploy, we could just skip the installation of requirements.txt, that is done with when running with docker compose with INIT=t

- We don't need all those files in the context
- WORKDIR creates all missing directories
@stsewd stsewd requested a review from a team January 13, 2020 18:16
@ericholscher ericholscher requested a review from humitos January 16, 2020 23:29
@humitos
Copy link
Member

humitos commented Jan 17, 2020

I think I'm fine with these changes. Although, I need to pull down the branch and re-build the image to be 100% sure.

WORKDIR creates all missing directories

All the paths from docker-compose are based on where the code is clone, etc. So, if we remove the workdir we will probably end up with files located in different places and we will need to update them as well.

Also, since we are not using this image for deploy, we could just skip the installation of requirements.txt, that is done with when running with docker compose with INIT=t

I prefer to have everything that it's known to be installed already in the image. It speed up things after removing the container with down. Otherwise, each time you do a down and then an up you need to re-install all the requirements again (--init is not needed in that case).

@stsewd
Copy link
Member Author

stsewd commented Jan 20, 2020

All the paths from docker-compose are based on where the code is clone, etc. So, if we remove the workdir we will probably end up with files located in different places and we will need to update them as well.

Docker compose uses the mounted directories actually

I prefer to have everything that it's known to be installed already in the image. It speed up things after removing the container with down. Otherwise, each time you do a down and then an up you need to re-install all the requirements again (--init is not needed in that case).

That's why you should use start and stop instead of up/down

@humitos
Copy link
Member

humitos commented Jan 20, 2020

Docker compose uses the mounted directories actually

Good point. Did you test this Dockerfile and built it properly with current master?

@stsewd
Copy link
Member Author

stsewd commented Jan 20, 2020

Good point. Did you test this Dockerfile and built it properly with current master?

Yeah

@humitos humitos merged commit f8cf3db into readthedocs:master Jan 22, 2020
@stsewd stsewd deleted the simplify-docker-image branch January 22, 2020 14:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants