-
Notifications
You must be signed in to change notification settings - Fork 0
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
Dockerize Improvements #32
Comments
Hello @harshit82, if you are still interested you can take this task related to Docker. |
Thanks a lot for this, I will need some guidance. |
Any file you want me to start from? |
My bad I didn't tell you the context about the solution. Well in short there are APIs and Web Apps to manage a Vet Clinic. You may find it useful to see the README file about how deploy and test the entire solution. |
For this Feature/Task. We can get focus in docker-compose.DockerDevelopment.yml and docker-compose.DockerNginx.yml at repository folder. Any of those files will show us how the containers (Services) are configured and where their Dockerfiles are located to build their images. |
To achive the third Criteria we can explore, compare and select related official images based on different Linux OS like debian, alpine, ubuntu, etc. As example, if we look into a docker compose file at the entry labeled service called public-web, we can see where its Dockerfile is (.../Public/src/Fnunez.VeterinaryClinic.Public.Web/Dockerfile). Working the third Criteria (Build smaller and secure images): Then we could do some search at Docker's hub site for smallest official lighter images related to our current parent images. Surfing on https://hub.docker.com/_/microsoft-dotnet we can see that there are a block called "Featured Repos" where we could get the ASP NET Core Runtime repo image (https://hub.docker.com/_/microsoft-dotnet-aspnet) and explore for a Tag Listing based on Linux which alpine is used to be the smallest and optimized image. So taking the latest alpine version (7.0.203-alpine3.17-amd64) we just need to specify as the following line: After that, we will do the same for NET SDK (https://hub.docker.com/_/microsoft-dotnet-sdk) which currently and latest version is 7.0.203-alpine3.17-amd64. And would looks like: |
Now the local Docker image for public-web would be smaller than before.
|
Just comparing and playing a bit with old and new public-web image Building and deploying the current/previous image through terminal: docker-compose -f docker-compose.DockerNginx.yml build public-web --no-cache docker-compose -f docker-compose.DockerNginx.yml up public-web -d docker image list We will see the current public-web image size is around 223 mb. After edit the Dockerfile just re-build and re-deploy it: docker-compose -f docker-compose.DockerNginx.yml down docker-compose -f docker-compose.DockerNginx.yml build public-web --no-cache docker-compose -f docker-compose.DockerNginx.yml up public-web -d docker image list We will see again the new public-web image size is around 119 mb. In fact we reduced the image sizing from 223 mb to 119 mb. |
As a product owner, I want improve the current Docker files and composes involved on each project. Should be applying best practices to care about security and performance. Inpsect and find standard conventions used on Docker Compose files that could had been missed into existing.
Criteria:
Plus (Extra):
The text was updated successfully, but these errors were encountered: