Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Should I use Docker when developing an Angular application? [closed]

We are a group of around 15 developers working on the same project. Some are working on the FE side(Angular 5) and some are working on the BE side(python, go and postgressql).

As developers come and go, it’s getting really hard to create new dev environment and maintain it. Also, moving from one version of the app to another becomes really hard as there are constant DB changes.

We have a bash script that pulls all the repositories from GitHub and install them, but we want to start using something more professional.

We thought about using Docker for that. I have read quite a bit on it and it seems like a perfect deployment solution for us.

But my question is if Docker is the right solution for our development cycle as well.

There are tons of good tutorial of how to create a Docker image and deploy it but I couldn’t find a solution to my question. If the answer is yes, how do I serve an ng app and watching the file changes as we develop new features?

Maybe Vagrant is a better solution?

like image 867
doron Avatar asked Oct 28 '22 20:10

doron


2 Answers

For the backend part it can do the job perfectly. You can even reset the database on each container restart or load fixtures to do an environment reset. Use a volume to put your code into de container so you don’t need to rebuild it during develop. For the angular part I don’t see any advantage as that code is executed on the browser. You can consume the Api served by Docker but Docker will not help to you to develop Angular faster in any other point.

like image 66
Carlos Avatar answered Nov 18 '22 13:11

Carlos


We recently moved from using Vagrant to using Docker to create dev environments for our team. Dependency management is the real advantage, as we can basically just docker-compose up, and every application component is running, including a dev environment container we can docker exec -it <container-name> bash into. It makes it possible to develop on literally any platform that can run Docker, with no other dependencies installed.

The disadvantage is that there is a bit of extra start-up time and boiler plate. I still prefer to just install dependencies on my host machine when possible. Docker can help enable that too though. The dev environment Dockerfile serves as a source of truth anytime you need to look up dependencies, and components that require something I can't install locally (like Ubuntu), can be run from within their own Docker container, while I work on other components (like a JS front-end) on my host machine.

Anyway, I think it is a decent way of managing a project. Better than Vagrant certainly. If you are curious for something to reference, you can checkout https://github.com/hyperledger/sawtooth-supply-chain. It's got the dev environment (supply-shell), two Mithril.js clients which are served by Apache containers, a Node.js API (supply-server), a RethinkDB container, plus a bunch of blockchain components running in various containers.

like image 34
Zac Delventhal Avatar answered Nov 18 '22 14:11

Zac Delventhal