Coder Social home page Coder Social logo

django-react-docker's Introduction

docker-django-react-mysql-redis-nginx

Description

This repository contains a sample project demonstrating the integration of Django, React, Docker and all served behind NGINX and reverse proxy.

Main Frameworks/Libraries/Packages

  • Django Backend: Provides the backend logic and APIs for the web application.
  • React Frontend: The frontend code pulls from this repo.
  • Docker Configuration: Use Dockerfiles and docker-compose configuration for containerizing the Django, React and NGINX applications.
  • Database Integration: Used my-sql for data persistence.
  • Cache Integration: Used redis for data caching.

Prerequisites

Before you begin, ensure you have met the following requirements:

  • Need to Docker installed on your local machine.

Usage

To set up and run the project locally, follow these steps:

Clone the repository:

git clone https://github.com/Ivanshamir/django-react-docker.git

Navigate to the project directory:

cd django-react-docker

Now copy .env.example and rename to .env:

cp .env.example .env

Build and run the Docker containers using Docker Compose:

docker-compose up -d

Now you can access to the application using this url http://localhost:8000 in your browser.

To stop the containers, use Ctrl + C and then run:

docker-compose down

View logs by service name.

docker compose logs <service-name>

Enter shell for specified container (must be running)

docker exec -it <container-name> sh

Containers, Services and Ports

Container Service Host Port Docker Port
api api 5008 5000
client client-service 3000 80
db db 33061 3306
redis redis 63792 6379
nginx_server nginx 8080 80

Can this be used for production?

This project is focused on making it easier to perform local full stack development. However, it is possible to add new docker compose and docker files to also support production. It's just out of scope for this project. Please have a look in the archives folder for some old production docker files to give you an idea of what worked in the past.

django-react-docker's People

Contributors

ivanshamir avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.