Open Martinsos opened 3 years ago
I asked for thought of people in our community, and the main feedback was that Dockerized stuff can have performance problems (especially when dealing with filesystem operations on MacOS) and that while they would like everything Dockerized as an option, they don't think it should be the only way of running Wasp locally. It does sound from this like Dockerizing everything could be problem because of the performance issues. I think we should still give it some thought, but we have to be very cautions regarding the performance and possible limitations. Running just DB in Docker is ok though.
Here is link to my message where I started the discussion: https://discord.com/channels/686873244791210014/686873245428875297/821698905477218354 .
Below I also copied the discussion, just in case:
Adding my 2 cents, I think Dockerized stuff has performance problems on OS X, but on Linux it's perfectly fine. This StackOverflow answer explains quite nicely why there is a difference: https://stackoverflow.com/a/55953023/1233908
Personally I'm a Docker convert ever since making the switch from OS X to Linux, but I can understand the frustration there for OS X users.
Thanks for the comment @cursorial! Yes, on Linux it should be fine, but OSX is tricky. I however read that using docker volumes can help, instead of directly binding the directory from the file system, so maybe that is a way to go about it. Docker volumes should be much more performant, even on OSX, possibly to the level where this is not an issue anymore.
Just to add to this: using docker volumes is the way to go to persist data on host machine, and they don't have performance issues, I can confirm that after more research / using them.
Right now, we have Dockerfile for deploying server to production.
We could also use Docker in development though -> both web app and server could be running in their own docker containers, therefore ensuring that they run in exactly the same way for all the developers. This would remove explicit dependency on node, which would become part of the container and therefore part of implementation. So basically, only dependency would be on docker -> if you have docker, you can use wasp.
This does seem to be somewhat tricky, as it can disrupt typical development flow and possibly slow it down. I don't know all the details, but I "heard" it might be tricky getting it to work with the IDE of choice + debugger, possibly also live reloading of web browser. Also, what if web app requires something installed on the machine, and we don't have it already in the Dockerfile? How would we set that up, enable people to install whatever they need? Maybe they could provide base image to build Dockerfiles from, and we can say it has to be Ubuntu or smth like that?