Deployment
Adds dockerfiles + compose for dev environment. Proxy call to external api to https
Workflow:
We want 1 container = 1 process. This one of the most important rule in docker.
We use multi-stage build & builder workflow for reusability, to optimize the image size, build time and seperate concerns.
There 3 docker images:
- Base Image with all node_modules needed to run and build the app (this image is updated only when packages.json is updated)
- API Image with all node_modules needed to run the API
- Frontend Image with all node_modules needed to build the frontend assets. There are 2 steps, build the frontend assets and then copy those in a an nginx container.
In order to optimize this workflow, either we should seperate the frontend from the backend in different repos/folders or if we keep this architecture all prod node_modules should only be the modules neeed to run the API and dev node_modules those neeed to build the assets.
Then we will have docker images that are slim, replicable and that do only what it is asked for.
TODO:
-
update doc -
config env variables -
use elife client-config component for build time variables -
add compose example for prod with letsencrypt
Edited by Timothee Gosselin