{"id":23036872,"url":"https://github.com/dieegogutierrez/portfolio","last_synced_at":"2026-05-06T22:10:21.130Z","repository":{"id":189967676,"uuid":"681673814","full_name":"dieegogutierrez/Portfolio","owner":"dieegogutierrez","description":"Portfolio website built with Flask hosted on a virtual machine on GCP","archived":false,"fork":false,"pushed_at":"2025-05-06T13:40:07.000Z","size":47051,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-06T14:58:28.446Z","etag":null,"topics":["cloudbuild","continuos-deployment","css3","flask","google-cloud-platform","html5","python"],"latest_commit_sha":null,"homepage":"https://dgutierrezengineer.com","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dieegogutierrez.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-08-22T14:07:39.000Z","updated_at":"2025-05-06T13:40:12.000Z","dependencies_parsed_at":null,"dependency_job_id":"bcbfe3d5-8b4f-48f8-a099-10a828285652","html_url":"https://github.com/dieegogutierrez/Portfolio","commit_stats":null,"previous_names":["dieegogutierrez/portfolio"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/dieegogutierrez/Portfolio","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dieegogutierrez%2FPortfolio","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dieegogutierrez%2FPortfolio/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dieegogutierrez%2FPortfolio/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dieegogutierrez%2FPortfolio/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dieegogutierrez","download_url":"https://codeload.github.com/dieegogutierrez/Portfolio/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dieegogutierrez%2FPortfolio/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32713922,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-06T19:35:05.142Z","status":"ssl_error","status_checked_at":"2026-05-06T19:35:03.996Z","response_time":117,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cloudbuild","continuos-deployment","css3","flask","google-cloud-platform","html5","python"],"created_at":"2024-12-15T17:27:59.048Z","updated_at":"2026-05-06T22:10:21.114Z","avatar_url":"https://github.com/dieegogutierrez.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Deploying Your Portfolio Website on a Virtual Machine on GCP with a Custom Domain\n\nThis guide provides the steps to deploy your portfolio website on a VM instance on Google Cloud Platform (GCP) with a custom domain.\nClick [HERE](https://dgutierrezengineer.com) to check the website.\n\n## Step 0: Create your VM on Compute Engine, your custom domain on Google Domains and DNS records on Cloud DNS\n\n1. There is a free tier VM option available on GCP, follow the required settings.\n2. Create a domain from Google Domains\n3. Go to Cloud DNS and create DNS records\n\nAdd or update the A records as follows:\n- Host: @ (or leave blank, depending on the registrar)\n- Type: A\n- Value: Your GCE instance's external IP address\n- TTL: Default or 3600 seconds\nAdd or update the A records for the www subdomain:\n- Host: www\n- Type: A\n- Value: Your GCE instance's external IP address\n- TTL: Default or 3600 seconds\n\nVerify DNS Propagation:\n\nAfter updating your DNS records, it may take some time for the changes to propagate. You can check the status of your DNS records using a tool like [DNS Checker](https://dnschecker.org/).\n\n## Step 1: Set Up Your Environment\n\nSSH into your VM:\n- Click on SSH in Compute Engine or use the command below:\n```bash\ngcloud compute ssh your-vm-instance-name\n```\nUpdate the package list to ensure you have the latest information on the newest versions of packages and their dependencies:\n```bash\nsudo apt-get update\n```\nInstall pip, the package installer for Python 3. The VM already had python3:\n```bash\nsudo apt install python3-pip\n```\nClone your portfolio repository from GitHub:\n```bash\ngit clone https://github.com/dieegogutierrez/Portfolio.git\n```\nChange directory to the cloned repository:\n```bash\ncd Portfolio/\n```\nCreate a virtual environment:\n```bash\npython3 -m venv venv\n```\nActivate the virtual environemnt:\n```bash\nsource venv/bin/activate\n```\nInstall the required Python packages as specified in the requirements.txt file:\n```bash\npip3 install -r requirements.txt\n```\nInstall Nginx, a web server that will be used to serve your application:\n```bash\nsudo apt install nginx\n```\n\n## Step 2: Configure Gunicorn\n\nCreate a Gunicorn systemd service file:\n```bash\nsudo nano /etc/systemd/system/portfolio.service\n```\nAdd the following content, change it accordingly:\n```makefile\n[Unit]\nDescription=gunicorn daemon for portfolio\nAfter=network.target\n\n[Service]\nUser=dieego_gutierrez\nGroup=www-data\nWorkingDirectory=/home/dieego_gutierrez/Portfolio\nEnvironment=\"PATH=/home/dieego_gutierrez/Portfolio/venv/bin\"\nExecStart=/home/dieego_gutierrez/Portfolio/venv/bin/gunicorn --workers 3 --bind unix:/home/dieego_gutierrez/Portfolio/portfolio.sock run:app\n\n[Install]\nWantedBy=multi-user.target\n```\nStart and enable the Gunicorn service:\n```bash\nsudo systemctl start portfolio\nsudo systemctl enable portfolio\n```\n\n## Step 3: Configure Nginx\n\nRemove the default configuration:\n```bash\nsudo rm /etc/nginx/sites-enabled/default\n```\nCreate a new Nginx configuration file:\n```bash\nsudo nano /etc/nginx/sites-available/portfolio\n```\nAdd the following content, change it accordingly:\n```bash\nserver {\n    listen 80;\n    server_name dgutierrezengineer.com www.dgutierrezengineer.com;\n\n    location / {\n        proxy_pass http://unix:/home/dieego_gutierrez/Portfolio/portfolio.sock;\n        proxy_set_header Host $host;\n        proxy_set_header X-Real-IP $remote_addr;\n        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;\n        proxy_set_header X-Forwarded-Proto $scheme;\n    }\n}\n```\nEnable the configuration:\n```bash\nsudo ln -s /etc/nginx/sites-available/yourprojectname /etc/nginx/sites-enabled\n```\nTest and reload Nginx:\n```bash\nsudo nginx -t\nsudo systemctl restart nginx\n```\n\n## Step 4: Enable HTTPS with Certbot\n\nInstall Certbot and the Nginx plugin:\n```bash\nsudo apt install certbot python3-certbot-nginx\n```\nObtain the SSL certificate:\n```bash\nsudo certbot --nginx -d dgutierrezengineer.com -d www.dgutierrezengineer.com\n```\n\n## Step 5: Verify Your Deployment\n\nCheck the status of Gunicorn and Nginx:\n```bash\nsudo systemctl status portfolio\nsudo systemctl status nginx\n```\n\n## Step 6: Continuos Deployment with Cloud Build\n\n[DOCUMENTATION](https://cloud.google.com/build/docs/automating-builds/github/connect-repo-github#console)\n\nEnable Cloud Build API and Secret Manager API.\n\nOn Cloud Build Repositories 2nd gen create a new host connection.\n\nLink your repository.\n\nCreate a trigger and adapt the code below and create a cloudbuild.yml or use the inline option while creating the trigger.\n```yml\nsteps:\n  - name: 'gcr.io/cloud-builders/gcloud'\n    args: ['compute', 'ssh', 'your-vm-instance-name', '--zone', 'your-zone', '--command', 'git config --global --add safe.directory /home/your_username/Portfolio \u0026\u0026 cd /home/your_username/Portfolio \u0026\u0026 git pull origin main \u0026\u0026 sudo systemctl restart portfolio']\noptions:\n  logging: CLOUD_LOGGING_ONLY\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdieegogutierrez%2Fportfolio","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdieegogutierrez%2Fportfolio","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdieegogutierrez%2Fportfolio/lists"}