This is a basic boilerplate to get a quickly running React and Django in Docker.
This build consists of:
- React-scripts based React project in
frontend
folder with installed Semantic UI React lib - Clean Django project in
backend
folder - nginx server to handle port routing, so that there is a single entry-point
The goal of this boilerplate was to pack full-stack development environment into Docker Compose setup, so that developer has a hot reload single entry point with front-end in React and Django as an API.
-
Clone the repo.
-
Rename
.env-example
to.env.dev
and modify if needed. -
Hit:
$ docker-compose up
- Access the complete run: http://localhost:8080
Once you have it all running you can start editing your components in .js
or modify Django project.
In case you need real-time logs you can can run compose in non-interactive mode and then watch the logs directly from the running containers.
Below is a summary of what is where in case you need to access each part separately:
Container | Service | Docker Port | Host Port |
---|---|---|---|
dev-django | django | 8000 | 8001 |
dev-react | react | 3000 | 3001 |
dev-db | db | 5432 | 5432 |
dev-nginx | nginx | 80 | 8080 |