Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

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