Hi Everyone,
I am new to docker and have watched some tutorial videos and get the basic understanding of how docker works.
I am building a full stack app with flutter and using serverpod as backend, and I think docker is a good option to use to host my full stack app locally. My aim is to host this app locally on a private server so that the app only be used by devices that connected to the local network.
Which base image need to use for flutter?
A severpod project automatically generate 3 folder (client, frontend, backend), do I need to dockerize 3 seperated container?
If you can recommend any source to learn how to dockerize flutter and serverpod project, I greatly appreciated.
Please be aware that this is a community forums. Other Docker users are very helpful when you run into trouble, but they probably won’t write a tutorial especially for you.
Did you just try an Internet search? Any explicit issues with one result?
Indeed, you can easily search for dockerizing flutter apps, but luckily for you, I was curious as well so I searched for “docker examples dart” as Dart is the programming language in which Flutter was written.
One thing I would add to this guide after quickly scrolled through, is to never use the “latest” or “stable” tags when you really want your solutions to work tomorrow, not just today. Use a specific version.
What parts you containerize / dockerize is up to you, but generally, if you dockerize one component, you probably want to dockerize all. How many containers you use, depends on how scalable you want your app to be (easily run multiple instances of one component) and what the dependencies of the components are. If all have different dependencies, you most likely want to use different base images for each, instead of installing everything in one. And Docker containers usually run only one process and its children, so if all components have to run as separate processes, you want to run them in separate containers. Using process managers in containers is possible, but I would not start with that if you can run multiple containers instead.
To find base images, use Docker Hub
You can search for a framework, tool, or programming language. Use official images if you find any, unless it is hard to use, and you find another popular image that works. Just don’t choose an image that was downloaded by only 10 people, and has no documentation.