Basic setup connecting flask to a react node application.
The client directory was created using create-react-app
. There are two Dockerfiles used for the client. One is for local development, using the node development server. The other builds the app into static files which are then served to nginx.
The server is responsible for exposing an api endpoint for client consumption.
docker-compose -f conf/docker-dev.yml up
I have made this easier by adding a dev script
./scripts/dev.sh
Note that the react development server will compile and refresh on file changes
docker-compose -f conf/docker-prod.yml up
I have made this easier by adding a production script
./scripts/prod.sh
- expose new api endpoints in the server view
- read from endpoints in client