Hosting My Portfolio
12/06/25
The Mission
My next goal with the homelab was to also self-host my portfolio website. Now that I had a nice containerized Nginx reverse proxy setup, this would be quite easy so I had no reason not to. Yesterday I spent most of the day rewriting my website in PHP and plain JavaScript instead of the old Next.js slop that it was. This was so that it could be as lightweight as possible and avoid strain on my resources.
In order to host it seamlessly, I would have to follow the following steps:
- Add the public hostname (nicolldouglas.dev) to the Cloudflare tunnel and map it to http://nginx in order to pipe HTTP requests to Nginx.
- Create a Docker Compose file for setup, expose port 3002 for local access, and start the container.
- Create a workflow file for auto redeploy (I could just reuse the one for the blog).
- Create an Nginx site configuration to proxy requests to the site container's URL.
- Reload Nginx to register the new site.
So that's exactly what I did.
Setup & Deployment
After completing steps 1 and 2, I had the following docker-compose.yml
file defined in my homelab repo/directory (as well as .env
and deploy.sh
files):
services:
portfolio:
image: ${DOCKERHUB_IMAGE}
container_name: portfolio_website
restart: unless-stopped
networks:
- nginx-proxy-net
environment:
- APP_ENV=${APP_ENV}
ports:
- "3002:80"
networks:
nginx-proxy-net:
external: true
I copied over the workflow file from the blog repo to the portfolio repo since the deployment process was pretty much the same. After that I also copied the Nginx site configuration file for the blog and modified it appropriately for my portfolio site. Namely changing the server_name
directive to nicolldouglas.dev and the proxy_pass
directive to http://portfolio which would be the URL of the container on nginx-proxy-net
.
I then restarted the Nginx container (instead of reloading inside the container for whatever reason) and tested to see if the site was accessible in the browser as per usual. And indeed it was, so now you can access my portfolio at https://nicolldouglas.dev. It was also accessible locally at http://192.168.1.5:3002 which was good.
As I imagined, Dockerizing Nginx the way I did made setting up new sites and reverse proxies incredibly hassle-free.