Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/andrewrporter/flask-react-nginx
Utilizing docker-compose to tie a flask application with react through nginx
https://github.com/andrewrporter/flask-react-nginx
create-react-app docker docker-compose flask gunicorn-docker nginx react setup-tutorial
Last synced: 4 days ago
JSON representation
Utilizing docker-compose to tie a flask application with react through nginx
- Host: GitHub
- URL: https://github.com/andrewrporter/flask-react-nginx
- Owner: AndrewRPorter
- License: mit
- Created: 2020-03-29T18:55:08.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2022-07-18T13:00:02.000Z (over 2 years ago)
- Last Synced: 2024-12-26T11:40:41.390Z (11 days ago)
- Topics: create-react-app, docker, docker-compose, flask, gunicorn-docker, nginx, react, setup-tutorial
- Language: JavaScript
- Size: 1.47 MB
- Stars: 17
- Watchers: 4
- Forks: 8
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# flask-react-nginx
Basic setup connecting flask to a react node application.
## client
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.
## server
The server is responsible for exposing an api endpoint for client consumption.
## Development
`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_
## Production
`docker-compose -f conf/docker-prod.yml up`
I have made this easier by adding a production script
`./scripts/prod.sh`
## Usage
- expose new api endpoints in the server view
- read from endpoints in client