- Notifications
You must be signed in to change notification settings - Fork0
This project is a full-stack web application built using Django for the backend and React for the frontend. The application is deployed using Docker with a multi-container setup, incorporating NGINX as a reverse proxy and static and media file server, and PostgreSQL as the database.
harrybelafonte3/Multi-Container-Django-React-Application
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
This project is a full-stack web application built usingDjango for the backend andReact for the frontend. The application is deployed using Docker with a multi-container setup, incorporatingNGINX as a reverse proxy and static and media file server, andPostgreSQL as the database.

Multi-container application with three services:
backend: Runs the Django application in a container named backend_django. It uses a custom Dockerfile, loads environment variables from .env, and stores media files in a named volume media_data. This service depends on the postgres database.
proxy: Serves as the NGINX reverse proxy, handling requests and serving static and media files. It maps the host directory ./backend/staticfiles to /vol/staticfiles for serving static files and shares the media_data volume for media files. It exposes port 80 and depends on the backend service.
postgres: Runs a PostgreSQL database in a container named postgres_db. It uses environment variables for database credentials, stores data in the postgres_data volume, and exposes port 5432.
- TwoNamed volumes for persistent data storage for Database and Media files.
- Staticfiles are served usingBind mounts.
volumes: -postgres_data:/var/lib/postgresql/data# Named volumes -media_data:/vol/media# Named volumes -./backend/staticfiles:/vol/staticfiles# Bind mount
The NGINX container serves React, handles static & media files, and proxies requests to the Django backend.
server{listen80;location /api/{proxy_passhttp://backend:8000;}location /db_admin/{proxy_passhttp://backend:8000;}location /static/{alias /vol/staticfiles/;}location /media/{alias /vol/media/;}location /{root /usr/share/nginx/html;try_files$uri$uri/ /index.html;}}
Feel free to open issues or pull requests to contribute to this project!😊
About
This project is a full-stack web application built using Django for the backend and React for the frontend. The application is deployed using Docker with a multi-container setup, incorporating NGINX as a reverse proxy and static and media file server, and PostgreSQL as the database.
Topics
Resources
Uh oh!
There was an error while loading.Please reload this page.