Introduction
this is part 25 from the journey it's a long journey(360 day) so go please check previous parts , and if you need to walk in the journey with me please make sure to follow because I may post more than once in 1 Day but surely I will post daily at least one 😍.
And I will cover lot of tools as we move on.
Tips
Choose A good image The good image is the smallest one that make the job done , my favorite is alpine. there others just search for lightweight distros you will find a lot.
Install only what you are going to use Do not install apps that you are not going to use like developement tools such as vim plugins and what ever. It's not only about space , also it's about security the more you use the more you make your system vulnerable for more exploits.
Run containers the you want only Don't have multiple containers running in background that your not using , we talk before about how to stop containers.
make sure to use the ports your app really want , because more ports = more ways to get into your system.
make sure to every thing to be automated , so user doesn't want to excute any command in able to make that container will work perfectly , using an entrypoint that we talk about also.
make sure to setup .env to store all environment variables , also we see them in postgres example.
Do not save any data inside the container , instead use volumes that we talk about later . Also make sure to configure the permissions.
make sure that your container send logs directly to stdout , then you can access them using
docker logs
- read this website 12 factor carefully :)
End
this is the end of docker , there are more advanced later. I will make sure that I will do an full app from A to Z using all DevOps tools. Next tool is Kubernetes! stay tuned :)