Dockerized App for development and production #84
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This Pull Request is made for the issue #75 in which the app is dockerized using Docker and being ready to use either for development (using npm run start) and production (using npm run build and later being deployed into a nginx web server). Also I've modified the README to explain the commands used for building and running and also I've made a Makefile to make the execution kinda easy
The only problem with this is that Docker can insert environment variables into the containers but using the production container is not possible to insert them in runtime because the npm run build command needs the variables for building the static files, so you cannot pass new variables after building and to make it work, the .env file must be present into the container for building. There's a solution to pass variables after building during runtime but I haven't implemented here, maybe in a future Pull Request
Maybe there are some fixes or new feature that other people can implement like a code to deploy directly into AWS or GCP, or integrate the container into Kubernetes or Docker Swarm