Skip to content

DavidFG16/Portfolio

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

20 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸš€ Portfolio – DevOps Edition

A personal portfolio built from scratch with HTML, CSS, and JavaScript, without frontend frameworks, and enhanced with real DevOps practices: containerization, automated CI/CD, and deployment-ready infrastructure.

Local Code β†’ Docker β†’ GitHub Actions β†’ Docker Hub

πŸ“– Overview

This isn't just a static website. It's a fully containerized application with an automated pipeline that builds, tags, and publishes a production-ready Docker image on every push. The goal is to demonstrate how DevOps engineering applies even to the simplest projects, turning a personal portfolio into a deployable, reproducible system.


πŸ› οΈ Tech Stack

Layer Technology
Frontend HTML Β· CSS Β· JavaScript
Web Server Nginx (Alpine)
Container Docker
CI/CD GitHub Actions
Registry Docker Hub

πŸ“ Project Structure

Portfolio/
β”œβ”€β”€ index.html                # Main page
β”œβ”€β”€ style.css                 # Core styles
β”œβ”€β”€ mediaqueries.css          # Responsive breakpoints
β”œβ”€β”€ script.js                 # Interactions & animations
β”œβ”€β”€ i18n.js                   # EN/ES language support
β”œβ”€β”€ assets/                   # Images, PDFs, favicon
β”œβ”€β”€ Dockerfile                # Container definition (nginx:alpine)
β”œβ”€β”€ nginx.conf                # Custom Nginx config
β”œβ”€β”€ .dockerignore             # Files excluded from the image
β”œβ”€β”€ .github/
β”‚   └── workflows/
β”‚       └── deploy.yml        # CI/CD pipeline
└── scripts/
    └── deploy.sh             # Automated deployment script

🐳 Docker Setup

The portfolio runs inside a lightweight Nginx Alpine container. The custom nginx.conf enables gzip compression, static asset caching, and security headers, with no hardcoded domains.

Build & Run Locally

# Build the image
docker build -t portfolio-devops .

# Run the container
docker run -d -p 8080:80 --name portfolio portfolio-devops

Open http://localhost:8080 and you're done.

# Stop & clean up
docker stop portfolio && docker rm portfolio

βš™οΈ CI/CD Pipeline

Every push to main triggers a GitHub Actions workflow that:

  • Checks out the repository
  • Builds the Docker image using Buildx with layer caching
  • Tags it with latest and the short commit SHA
  • Pushes it to Docker Hub

Required GitHub Secrets

Secret Description
DOCKER_USERNAME Your Docker Hub username
DOCKER_PASSWORD Docker Hub access token or password

πŸ’‘ Use a Docker Hub Access Token instead of your password for better security.


πŸ“œ Deployment Script

The project includes a ready-to-use deployment script at scripts/deploy.sh. It automates the full container lifecycle on any machine with Docker installed, by stopping the old container, pulling the latest image, and starting a new one.

#!/usr/bin/env bash
set -euo pipefail

IMAGE="${1:-portfolio-devops:latest}"
CONTAINER_NAME="portfolio"
HOST_PORT=80

echo "β–Έ Stopping existing container (if any)..."
docker stop "$CONTAINER_NAME" 2>/dev/null || true
docker rm "$CONTAINER_NAME" 2>/dev/null || true

echo "β–Έ Pulling latest image: $IMAGE"
docker pull "$IMAGE" || echo "  (pull skipped – using local image)"

echo "β–Έ Starting container on port $HOST_PORT..."
docker run -d \
  --name "$CONTAINER_NAME" \
  --restart unless-stopped \
  -p "$HOST_PORT":80 \
  "$IMAGE"

echo "βœ” Portfolio is live at http://$(hostname -I 2>/dev/null | awk '{print $1}' || echo 'localhost'):$HOST_PORT"

Usage

chmod +x scripts/deploy.sh
./scripts/deploy.sh your-dockerhub-user/portfolio-devops:latest

The script works on any server with Docker (cloud VPS, local machine, or CI runner). Cloud deployment (AWS, etc.) is entirely optional.


🌐 Custom Domain

The Nginx configuration uses server_name _ so it accepts requests on any domain out of the box. To connect a custom domain, just point a DNS A record to your server's public IP, with no server-side changes needed.


✨ Final Note

This project is more than a portfolio; it's a demonstration of how containerization, automation, and infrastructure thinking can be applied to any project, no matter how small. Every push is built, tagged, and published automatically. Every deployment is one command away.

Built with πŸ› οΈ by David Gamboa

About

Discover my sleek and modern portfolio! πŸš€ Showcasing my skills as a software developer with a clean design, interactive projects, and a glimpse into my journey. Built with HTML, CSS, and a touch of creativity! ✨

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors