README.md for Hosting a Notes App on Ubuntu using React, Django, Nginx, and Docker
This guide will walk you through the steps to host a simple Notes App using React and Django on an Ubuntu server with Nginx as a reverse proxy and Docker to containerize the app.
- Ubuntu Server 20.04
- Python 3.9
- Node.js
- React
- Docker Installation:
- Update Ubuntu packages
sudo apt update
- Clone the repository
git clone https://github.com/Supu-27/Django-Notes-App.git
- Build the app
docker build -t notes-app .
- Run the app
docker run -d -p 8000:8000 notes-app:latest
- Install and configure Nginx as a reverse proxy
sudo apt install nginx
sudo systemctl status nginx
sudo systemctl restart nginx
#Nginx staic website
- Open Nginx configuration file
cd /etc/nginx/sites-enabled
sudo vim default
- Paste the following configuration into the file
location / {
proxy_pass http://127.0.0.1:8000;
}
location /api {
proxy_pass http://127.0.0.1:8000/api;
}
- Restart Nginx to apply the new configuration
sudo systemctl restart nginx
- Access the app on a web browser by navigating to http://your_domain_name_or_ip_address
Congratulations! You have successfully hosted a Notes App using React, Django, Nginx, and Docker on an Ubuntu server.