nginx on Docker

Docker Desktop

Realizing I didn’t really remember my setup for my raspberry pi instance and the fact that I didn’t have a sandbox install, I decided to test it out locally… And since the laptop got repaired, I didn’t have Docker installed anymore. So I installed the latest version: [[Docker Desktop]]@4.12.0. Didn’t bother with a docker.com account, although I should have one. I’m also doing this for purely edutainment purposes so no licensing!

Ran through the built in tutorial. Useful refresher and highly recommended.

Using the default Image:

nginx on Docker ūüĆź

Most basic install run it with a name of `some-nginx`, pulling the default `nginx` image… doesn’t actually do anything. It’s running, but not listening so you can’t use it.

```console
$ docker run --name some-nginx -d nginx
```

-p 80:80 now maps port 80 to expose it.

```console
$ docker run --name some-nginx -p 80:80 -d nginx
```

Success! Serving up some content at `http://localhost/`

Pasted image 20220906200113

Map custom content

Of course, that’s the default content. So let’s create a ‘content’ directory and serve up our own content – good refresher on volumes.

Their example maps `/some/content` to the doc root for nginx: `/usr/share/nginx/html`

```console
$ docker run --name some-nginx -v /some/content:/usr/share/nginx/html:ro -d nginx
```

So let’s create a file:

```console
$ mkdir content
$ cd content
$ cat >> index.html
<html>
<head>
<title> Secure BFFs TEst</title>
</head>
<body>
<h1>
Secure BFFs Test
</h1>
Hello wrold!
</html>
^D

$ cd ..
```

This creates an `index.html` file under the `content` directory. Now let’s map it into the index:

```console
$ docker run --name some-nginx -v content:/usr/share/nginx/html:ro -p 80:80 -d nginx 
```

Whoops, what happened? Same output?
Path needs to be full qualified!

```console
$ docker run --name some-nginx -v /Users/jlin/projects/https/content:/usr/share/nginx/html:ro -d -p 80:80 nginx
```

Success!
Pasted image 20220906202847

Conclusion

You now have a local docker instance running a fetched `nginx` instance serving up your own custom content!

Secure Meandering

Well, not really secure.  I did want to post some more things about getting Raspberry PI up and running.  But that ended up being fairly hard to do when you wanted your only Pi up and running.  I did make it pretty useful Рmostly a network server and the docker host running this blog.

I recently started using Obsidian and wanted to try to set up my own github repo Рbut Рnot over https this time, but over https.  What did that mean?  Secure Meadering! aka https on meander!

Looking into the Google Domains guild to enabling https on your domain took me to Letsencrypt:

If your web host doesn’t offer HTTPS security, you can obtain an SSL/TLS certificate for your domain from a CA. [Let’s Encrypt](https://letsencrypt.org/) is a CA that provides certificates in the interest of creating a safer Internet.

Reading up on some docker configurations like this one from zactyh ūüďĄ, I was reminded of ‘good’ containerized architecture. Leave each module as small and focused as possible.¬† But my wordpress instance was running double duty – handling requests and serving up wordpress.

Current

First meander.mezerkos.com System Diagram.excalidraw

Goal:
nginx meander.mezerkos.com System Diagram.excalidraw

Plan

Proof of Concept

– Play with nginx image to serve content somewhere other than my machine
– Get a cert and serve up content via https
– Proxy content to existing wordpress instance

Dockerize

– Repackage nginx image with my config
– Update docker compose to use new nginx image
– Run image on Raspberry Pi

Cleanup and follow up

– Lock down ports
– set up redirect

Let’s see how all this goes!

Wake Up! Time to Meander

“Wake Up! Time to die!” -Leon(Bladerunner)

Whelp, the site is back up again after a long-ish hiatus. It’s still WordPress, but running on a Docker image running on a Raspberry Pi. ‘Meander’ started out being hosted on 1&1 when I had some side gigs that needed hosting. But when those efforts died down, I moved things over the free tier of AWS. Primarily as a way to get some ‘free’ hosting as well as to get some more belated hands on ‘cloud’ experience. When that ran out, I just let it go.

I was looking for an easy project that had a clear goal and might clear off some cobwebs and get me a little more ‘geek cred’ again. I had been given some grief from my wife to clean up and get rid of some old legacy hardware lying around. But just getting those ancient towers up and running again to clean them out seemed like more effort that I was willing to give. I needed something easier to get me out of my rut. Combined with having to ‘share’ our family laptop(which was also running out of storage space), what was something I could give a few cycles have something to show for it and still be able to make progress on all fronts?

Getting a lightweight ‘server’ running at home seemed like a reasonable thing to try, right? It’s running now, and I could probably call it a success and call it a day. But why have a blog if you’re not going to post a little bit? Besides it’s a good way to reflect every once in a while.

SF Ride Report

After talking with some folks at work about Skyline and Highway 92, someone mentioned that 84 to the coast was where to find the action.  I finally got a day to myself and took a few hours out on the bike.

Unusual for a SF summer day, it was clear and warm, if a bit blustery. ¬†I suited up in the leathers, stuck Mendy in Sport mode and got onto the 280 – windy and not the most stable, but warm and clear. ¬†Onto the 101 -> 380 -> 92… Before Mendy reminded me I needed gas. ¬†I looped east on 92 to find gas. ¬†Fueled up and headed off, all the while the wind reminding me I hadn’t zipped the jacket into the pants. ¬†Pulled over to do just that and then back onto 92.

92 Traffic was horrible as usual.  Stop and go until the turnoff to 35.  Skyline was clear.  A few motorcyclists coming northbound, but it was everything I remembered.  Slow-ish blind corners, lots of shade against the bright Cali sun meant visibility was never that great.  As always, kind of missed my morning rides up Mt Seymour back in Vancouver.  I really hoped 84 was better.

Making it to Alice’s, I hung a right and got onto 84. ¬†Almost immediately, it became what I thought of when riding in California. ¬†Good mix of arid warm sections and green forest. ¬†Still pretty slow, I was stuck behind a few family sedans and another motorcyclist. ¬†But unlike the section of 35 north of Alice’s, visibility was better and the turns connected. ¬† Tipping into the corners and then that slick feeling tilting from one side to the next. ¬†Maybe lacking the rush of a true sportsbike, but being able to enjoy the actions of a single track vehicle in some gorgous scenery is what touring is all about!

84 T’s onto the 1. ¬†I headed south intending to make it to the first coffee shop, pull over and start this ride report. ¬†This really only made sense if I was still north of 92/Half-Moon Bay, but I guess I wasn’t 100% because I still went south. ¬†Not much in the way of amenities, but I did pull over to take a picture:

The California coast is pretty nice on the good days. ¬†But it is the 1, so that meant lots of wind and enough traffic that it’ll never be a great ride. ¬†Just a slow lazy tour to see all the tiny beaches along the way.

I passed Pescadaro, thinking I should stop there, but eventually made it to Highway 1 Brewing Company. ¬†Little brewpub in the middle of nowhere – no internet access! ¬†But I got a coffee and ordered some fried pickles and did some scribbling. ¬† They had some live music and the staff were pretty nice. ¬† Not great coffee, super salty fried pickles – if it weren’t for location, not a place I would recommend. ¬†But sitting there by myself and getting a chance to reflect was really nice. ¬†That place is probably a lot better when you are actually drinking there beer. ¬†But as the middle point in my first ride report in a long time, it will probably be something special for me.

Back on the road, heading up the coast, I considered going back up the 84, but thought I’d try something new. ¬†Again, not the best decision in the world, staying on the 1 meant slow, overcast and windy routes. ¬†I think the best part of making that loop was the reminder of how many micro-climes there are in the Bay Area. ¬†In the space of a few hours, weather was all over the place.

Back home, Potero was nice and warm! ¬†I got off the bike, collected my things to check my phone and a bunch of missed messages and pings from my wife. ¬†From the time I sent the coastal picture until I got home had been a few hours. ¬†And non-communication had freaked her out, thinking I had gotten into an accident or something. ¬†We had a quick phone call, I got changed and went out to meet her at Philz…

Walking there, I realized how much of a toll the ride had taken on me. ¬†My back hurt, my legs were achey, my hands were tired – For the last half hour of the ride, I actually used my cramp-buster throttle lever. ¬†I think upon reflection, my single days of random touring are over. ¬†‘Motorcyclist’ has always been part of my identity and I’d like for it to continue to be so. ¬†But like so many other things in life, it isn’t something that will just happen anymore. ¬†I’m going to have to invest the time to plan and schedule it in my life.

Eggnog Nashville

Ever wondered why Eggnog is even a thing? Find the saccharine filled carton from the local supermarket repulsive and only palatable with copious portions of rum? Wonder no more! Eggnog is essentially cake batter, with the superfluous flour replaced with booze. Should be delicious, right? With a little effort, you will start your own holiday tradition!

Ingredients:
18 eggs, separated
2 cups of sugar
3L of cream
2 to 4 cups of Bourbon
1 to 2 cups of Jamaica rum
1 to 2 cups of Brandy

393587_10150492449755499_720907122_n

Steps:
1) Beat egg whites until soft peaks form and set aside

378646_10150492440850499_364742583_n
2) Mix the egg yolks and sugar on high until well blended and pale yellow
3) Add the bourbon, brandy, rum and cream

388288_10150492441765499_702429891_n
4) Fold in egg whites until evenly mixed

392336_10150492453705499_1548565457_n
5) Age and enjoy garnished with some nutmeg386729_10150492442110499_847965154_n

 

Okay, just accept that this recipe takes some serious commitment. It makes makes a *lot* of eggnog and takes up a lot of space. With the beaten egg whites, you need a very spacious container to do the folding (I use a stock pot). But trust me – it is time, effort and money well spent. There is no better way to get into the holiday spirit!

Tips:
– Use good booze. If you don’t, this will burn going down (even if it does, don’t worry, it will mellow with age)
– Make this well ahead of time. It is delicious, but gets better as it ages. The sweet spot seems to be about 3 weeks. I usually made it during Thanksgiving for Xmas parties.
– Adjust your type of cream according to how much alcohol is being added. Lighter cream(half & half) for the bottom end and full fat heavy cream for full portions

Pinnacle National Park

Very pretty… And very random set of rocks. ¬†Very out of place in Cali. ¬†Kind of like stuff you’d see in New Mexico and Utah, but in a much smaller scale? ¬†Still cool though.

Best part is the verticals… Steep enough that even I wanted to use the handholds and go down backwards. ¬†Would love to do it again and check out the Balcony caves…

Alouette Lake Hike

Some real hiking. Vancouver style Рrain, muck and snow.  Fallen logs and ladders.  Awesome hike.

Muir Woods Hike

Back way in… got totally lost and didn’t hike any of the route we wanted, but still a great day.

Road Trip to Yosemite Part 2

Another slow start… Didn’t leave the place until after noon. ¬† It was our last day and had to clean up after ourselves. ¬†Too bad, should have spent more time there!

But we did get into the valley and did a quick walk to Bridal Veil and then over to do Yosemite falls.  It was awesome!   Wish we had more time to be able to do a more complete hike.  Will have to save it for next time!

Road trip to Yosemite Part 1- Mariposa Grove

Like all trips, planning was ambitious.  We wanted to leave early and grab a bunch of things on our way south.  It largely went to plan, but probably more pain than necessary.

First, leaving work at all was difficult.  After a week of iOS training, I wanted to get a feature launched or dark launched before the weekend. But even after much scrambling, we just had to call it off.  But it did mean the original plan to leave the South Bay was delayed.  Did manage to pick everyone up, swing by to pick up boerewors sausage and get groceries in Gilroy and make it to the AirBnB by 10.  Late, but was a pretty awesome pad.  Hung out and chilled for a few hours before calling it a night.

Next morning, I woke up ridiculously early as usual and proceeded to make breakfast for everyone.   Annoyed the poor guy sleeping in the living room closest to the kitchen a little bit, but it was worth it to wake everyone up with actual food.  Marshmallow French Toast with bacon!   Delicious.   Was also able to pack up lunch for everyone.

Getting out the door was a bit rough. ¬†Unfortunately with only a single car, it meant everyone had to be ready at the same time. ¬†Never easy… But we did get out the door a little after noon on and make it to Mariposa Grove for a bit of a hike. ¬†It was a short hike 2.5miles… We figured we’d be done in an hour or so…

But snow!  And pictures!   So the hike took a lot longer than planned.  But it was a ton of fun!

But by the time we made it into the valley, the Visitor’s Centre was closed. ¬†They were still kind enough to open the door to let me stamp my passport.

Back to Oakhurst to pick up groceries for dinner and lunch the next day. ¬† Group dinner of Rack of Lamb and roast veggies! ¬†Delicious… ¬†Then hot tub and smores. ¬†It was an amazing night!