Skip to content

Gibwanjau/yolo

 
 

Repository files navigation

YOLO Full-Stack Application Deployment

![Project Architecture]

Table of Contents

Project Overview

This repository contains a Docker-optimized full-stack application featuring:

  • Frontend: React.js (Create React App)
  • Backend: Node.js REST API
  • Database: MongoDB with persistent storage
  • Infrastructure: Docker containers with multi-stage builds

Optimized Deployment Architecture

Key Improvements in v2.0:

  1. 68% Size Reduction (From 180MB to 58MB per service)
  2. Security Hardening (Non-root users, read-only filesystems)
  3. Build/Runtime Separation (Multi-stage Dockerfiles)
  4. Health Monitoring (Container healthchecks)
  5. CI/CD Ready (GitHub Actions workflow)

Size Optimization

Prerequisites

Tool Version Installation Guide
Docker Engine 20.10+ Official Guide
Docker Compose 2.5+ Official Guide
Node.js 16+ NVM Guide

Getting Started

1. Clone Repository

git clone https://github.com/Vinge1718/yolo.git
cd yolo
2. Build and Run (Development)
bash
docker compose up -d --build
3. Build and Run (Production)
bash
DOCKERFILE=Dockerfile.prod docker compose -f docker-compose.prod.yml up -d --build
Access endpoints:

Frontend: http://localhost:3000

Backend API: http://localhost:5000

MongoDB: mongodb://localhost:27017
## Docker Configuration

### Production vs Development Builds

| Feature                | `Dockerfile` (Dev)               | `Dockerfile.prod` (Production)       |
|------------------------|-----------------------------------|---------------------------------------|
| **Base Image**         | `node:16-alpine`                 | `alpine:3.18` + Node runtime only     |
| **Dependencies**       | Includes devDependencies         | Only production dependencies          |
| **User Context**       | Root (for debugging)             | Dedicated non-root user (`appuser`)    |
| **Build Process**      | Single-stage                     | Multi-stage with build separation     |
| **Health Checks**      | Basic                            | Comprehensive endpoint monitoring     |
| **Filesystem**         | Read/Write                       | Read-only where possible              |
| **Size**               | ~180MB                           | ~58MB (68% reduction)                |
| **Security**           | Standard                         | Non-root user, minimized privileges   |
| **ENTRYPOINT**         | None                             | `tini` init system                    |
| **Caching**            | Basic layer caching              | Optimized dependency caching          |
| **Debugging**          | Full source access               | Only built artifacts                  |
| **Use Case**           | Development/testing              | Production deployments                |

About

Nodejs, Express API and MongoDB e-commerce feature project

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • JavaScript 72.8%
  • CSS 19.9%
  • Dockerfile 4.8%
  • HTML 2.5%