This repository provides a starter template for a full-stack web application built using Django and React, containerized with Docker. It includes a pre-configured development environment and instructions to set up, create, and run a new Django backend and a React frontend project with Docker Compose.
- Backend: A Django project with a PostgreSQL database, using Docker for an isolated development environment.
- Frontend: A React project created with Create React App, also containerized with Docker.
- Docker Compose: Simplifies the process of building and running multiple containers, making it easy to manage the application's services.
- Customizable: The template can be easily extended and customized to suit specific application requirements.
django-react-docker/ │ ├─ backend/ │ ├─ Dockerfile │ └─ requirements.txt │ ├─ frontend/ │ └─ Dockerfile │ ├─ docker-compose.yml ├─ README.md └─ .env.example
- Clone the repository.
git clone https://github.com/IvanBR1/django-react-docker.git cd django-react-docker
- Copy the
.env.example
file to a new file named.env
:
cp .env.example .env
Update the values in the .env
file as needed.
- Build the Docker containers:
docker-compose build
- Start the Docker containers:
docker-compose up
- To access the backend container's shell, run:
docker-compose exec backend bash
- To access the frontend container's shell, run:
docker-compose exec frontend bash
The template ensures that a new Django project is created automatically if one doesn't already exist in the backend
folder, and similarly, a new React project is created in the frontend
folder. This allows developers to quickly set up a development environment and start building their Django-React applications.