I’m trying to get my head around a the development workflow for working with microservices and docker multicontainer applications.
The thing that I’m particularly trying to solve – is getting a good ‘live reload’ workflow going for development.
For example:
For my frontend I can use webpack-dev-server which automatically reloads the page everytime I save changes. This makes it easy to write front end code quickly – with no waiting for deployments.
However – if the frontend is displaying some data retrieved from a REST API, I’m likely going to be running either a development version of that API (that itself is live reloading with nodemon, or similar) or a mocked API. This is easy enough to achieve with webpack using the proxy configurations for development environment.
For my REST API – I similarly might want to be mocking other microservices. For example if my REST API had a POST endpoint for saving an image – and I’m going to save that to an AWS S3 bucket, via the aws-sdk, I’m likely to want to be mocking that functionality.
Essentially – what it looks like – is that for every (or most) microservices – I’m also going to want to create a mock version of it.
My question is:
- Is this a standard way of doing things, or am I going way off base?
- Is there a way in docker to quickly switch between whether I’m using the real microservice or the mocked one?