dwyl / learn-docker

🚢 Learn how to use docker.io containers to consistently deploy your apps on any infrastructure.
230 stars 32 forks source link

Tutorial - Setup a Phoenix application with Docker? #15

Open SimonLab opened 5 years ago

SimonLab commented 5 years ago

The "PETE" stack is using some languages/framework that evolve rapidly (ex: elm 0.18 to 0.19 recently, see also the list of the release versions for Phoenix https://github.com/phoenixframework/phoenix/releases).

Making sure that all the versions are up to date or at least that the dev team is running projects with the same versions is time consuming. For example on each new project I have to go back and read again the installation page for Phoenix (https://hexdocs.pm/phoenix/installation.html) to make sure that everything is setup properly.

I think Docker can help us to reduce the setup time for new projects but most importantly it can make sure that all the team is running exactly the same stack and data (especially making sure that Postgres contains the same data for everyone)

Goal: Create a guide which explain how to setup a "PETE" application with Docker that we can reuse each time a new project is started

nelsonic commented 5 years ago

@SimonLab yes, Docker can help with "pinning" dependencies in certain situations, but it also adds a layer of complexity and overhead so our "learn-docker" needs to be super beginner-friendly while still covering the more advanced topics like "how to purge zombie containers"...

If you are able to do some research on this in the context of a phoenix project it would be good if you could also "cache" the Elm/Node dependencies for faster build on CI see: https://github.com/dwyl/learn-elm/issues/116

Thanks for taking this on! ✨

RobStallion commented 5 years ago

There is a docker mastery course on Udemy which looks like it goes into all the details of docker that we could want or need. It seems like this will be a good way to get a great understanding quickly. It is available on the Founders and Coders Udemy account.

nelsonic commented 5 years ago

@RobStallion if you end up following the Udemy course, which by all accounts is good, 👍 Please consolidate the knowledge into the README.md to save everyone else time. ⏳

.then read: https://www.reddit.com/r/programming/comments/8ub0vj/why_udemy_is_bad 🙄

RobStallion commented 5 years ago

@nelsonic I will do 👍 😂

nelsonic commented 4 years ago

@SimonLab did you manage to create a Dockerfile and/or docker-compose.yml for running a Phoenix app? Do we have an example (or client) App that is working with Docker?

I'm busy reading this: https://pspdfkit.com/blog/2018/how-to-run-your-phoenix-application-with-docker

SimonLab commented 4 years ago

I've created the following section of the readme https://github.com/dwyl/learn-docker#docker-and-pete-stack but it might need to be updated. Otherwise at the moment I'm only using docker for running Postgres.

nelsonic commented 4 years ago

@SimonLab Thanks for reminding us of the Docker and PETE section. Agree it could be updated. 👍 I also only need Docker for Postgres on Linode (weekend project https://github.com/dwyl/product-roadmap/issues/7 ...)