8000 GitHub - scarar/dev_portfolio_simplified: Customizable Professional Developer Portfolio for Beginners with Docker Stack
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

scarar/dev_portfolio_simplified

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dev_portfolio_simplified

Customizable Professional Developer Portfolio for Beginners with Docker Stack

Video Tutorial

This repository was created as a resource for my YouTube tutorial.

Instructions

🏠 Develop Locally 🏠

  1. Run your app and view it in your browser @ localhost or localhost:80:
cd dev_portfolio_simplified
docker compose up
  1. update init_db.py with your personal information and projects.
  2. update static/style.css with your favourite styling.
  3. update static/script.js with your JavaScript browser intercations.
  4. saving each of the above files, and refreshing the web page - will automatically update your website locally.

🚀 Publish on a Remote Server 🚀

  1. switch to a production server like Green Unicorn, by updating your Dockerfile:
FROM python:3.12-slim
WORKDIR /app
RUN pip install flask
RUN pip install gunicorn
COPY . .
CMD ["gunicorn", "--workers=5", "--bind", "0.0.0.0:5000", "main:app"]
  1. pre-build a Docker image, to later specify it in your docker-compose file:
docker build -t my-portfolio .
  1. update docker-compose file with the pre-build image:
services:
  web:
    image: my-portfolio:latest
    ports:
      - "80:5000"
    volumes:
      - ./:/app
    deploy:
      restart_policy:
        condition: any

  updater:
    image: my-portfolio:latest
    command: ["tail", "-f", "/dev/null"]
    volumes:
      - ./:/app
    deploy:
      restart_policy:
        condition: any
  1. activate swarm more and deploy the GUI and database services in a stack:
docker build -t my-portfolio .
docker swarm init
docker stack deploy -c docker-compose.yml my-portfolio
  1. update init_db.py and save it.
  2. find container id of the database updater service with: docker ps
  3. update database service without collapsing the application
docker exec [CONTAINER ID GOES HERE] python3 /app/init_db.py

💵 Coupon Code 💵

For 10% off on your VPS plan please navigate to:
http://hostinger.com/pythonsimplified

And enter the coupon code: PYTHONSIMPLIFIED

📚 Further Learning 📚

If you're not sure what Flask is, or why do we need Docker, or how on earth do we work with SQLite, please checkout the following learning resources on YouTube to get you up to speed:

⭐ Simple Hello World Web App with Flask:
https://youtu.be/6plVs_ytIH8
⭐ Introduction to SQLite:
https://youtu.be/Ohj-CqALrwk
⭐ Advanced Web App with Flask, and SQLite:
https://youtu.be/v3CSQkPJtAc
⭐ Introduction to Docker:
https://youtu.be/-l7YocEQtA0

About

Customizable Professional Developer Portfolio for Beginners with Docker Stack

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 39.3%
  • CSS 38.5%
  • HTML 18.0%
  • JavaScript 3.3%
  • Dockerfile 0.9%
0