This repo is built as a simple boilerplate to deploy a React front-end app with a Python backend api and a Postgres database using docker-compose.
Start an application with a Python Sanic backend using a postgres database and node.js React frontend, deploy with Docker quickly.
- Docker 1.12.0+
To get started, run the following commands in shell.
-
Build the docker images with docker-compose
make buildThis will build the
frontendandbackendimages -
Start docker-compose containers with the images
make upThis will start 3 docker containers:
db: a Postgres 12.x databasebackend: a bare-bone Python Sanic backend API withasyncpgto connect to the databasefrontend: anode.js12.x development server with the React front-end (based oncreate-react-app) that talks with thebackendthrough a proxy
Both the frontend and backend support live reload on changes.
A Makefile is provided with easy to use commands:
Starts the docker-composed containers for the frontend, backend and database
Shuts down the docker-composed containers
Build the docker image for frontend and backend
Provides an interactive bash shell into the Python backend
Provides an interactive bash shell into the node.js frontend
Run backend and frontend tests
Lint backend and frontend src files