Skip to content

Latest commit

 

History

History
131 lines (78 loc) · 2.5 KB

File metadata and controls

131 lines (78 loc) · 2.5 KB

DevOps Assignment – Documentation

Project Overview

This project demonstrates a containerized full-stack application using Docker and Docker Compose. The setup includes:

  • Backend: Django REST API
  • Frontend: React (Vite) served via Nginx
  • Deployment: Docker Compose (Local & Cloud-ready)

1. Setup Guide

1.1 Prerequisites

Ensure the following are installed:

  • Git
  • Docker
  • Docker Compose
  • Node.js (for local frontend testing – optional)
  • Python 3.11 (for local backend testing – optional)

1.2 Running the Project Locally

Step 1: Clone the Repository

git clone https://github.com/SanthoshkumarDevops/devops-assessment.git
cd devops-assessment

Step 2: Build and Start Containers
docker-compose up --build -d

Step 3: Verify Containers
docker ps

1.3 Access the Application (Local)

Frontend:
http://localhost:3000

Backend API:
http://localhost:8000/api/

Django Admin:
http://localhost:8000/admin/

1.4 Running on Cloud Server (EC2)
Step 1: Launch EC2 Instance

OS: Ubuntu 22.04

Open ports: 22, 80, 3000, 8000

Step 2: Install Docker & Docker Compose
sudo apt update
sudo apt install docker.io docker-compose -y
sudo usermod -aG docker ubuntu


(Re-login after this)

Step 3: Clone Repository on Server
git clone https://github.com/<your-username>/devops-assessment.git
cd devops-assessment

Step 4: Run Application
docker-compose up --build -d

1.5 Deployed Application URL

Frontend (Public):

http://<PUBLIC-IP>:3000


Backend API:

http://<PUBLIC-IP>:8000/api/

2. Troubleshooting Log
Issue 1: Docker Push Authorization Failed

Problem:
While pushing Docker images to Docker Hub, authorization errors occurred.

Root Cause:
Docker Desktop authentication and credential helper issues on Windows.

Solution:

Logged in using Docker Personal Access Token (PAT).

Restarted Docker Desktop and WSL.

Verified login using docker info.

Issue 2: Backend Container Failed to Start (SQLite Error)

Problem:
Django backend showed sqlite3.OperationalError: unable to open database file.

Root Cause:
Database file directory permissions inside the Docker container.

Solution:

Ensured correct working directory and permissions.

Rebuilt Docker image and container.

3. Screenshots

Screenshots of the running application and Docker containers are available in the /screenshots directory:

Docker Compose running

Frontend UI

Backend API response

4. Conclusion

This assignment demonstrates containerization, service orchestration, and deployment-ready DevOps practices using Docker and Docker Compose.


---