<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="4.3.2">Jekyll</generator><link href="/feed.xml" rel="self" type="application/atom+xml" /><link href="/" rel="alternate" type="text/html" /><updated>2024-07-09T22:38:04-07:00</updated><id>/feed.xml</id><title type="html">Blog of Dean Giberson</title><subtitle>I&apos;m a Sr Software Development Manager at Amazon working on AWS Snow. I built the Snowmobile and now I&apos;m working on growing the business. All comments are my own.</subtitle><author><name>Dean Giberson</name><email>dean@deangiberson.com</email></author><entry><title type="html">my naloxone kit</title><link href="/2024/07/09/my-naloxone-kit.html" rel="alternate" type="text/html" title="my naloxone kit" /><published>2024-07-09T00:00:00-07:00</published><updated>2024-07-09T00:00:00-07:00</updated><id>/2024/07/09/my-naloxone-kit</id><content type="html" xml:base="/2024/07/09/my-naloxone-kit.html"><![CDATA[<p>I carry a naloxone kit in my backpack.</p>

<p>I don’t use opioids.</p>

<p>I don’t intend to use opioids.</p>

<p>But that’s not the point.</p>

<p>.</p>

<p>.</p>

<p>.</p>

<p>In the summer of 2019 I was on the 7 heading home from Downtown to the Kitsilano apartment I shared with my wife. It was a perfectly normal day on transit. Hot. Stagnant air. Sweaty people. Stop and go from stop to stop on Granville Street. The whine of the electric bus. The clack-clack of the trolley bar on the overhead cables. People were zoning out.
<!--more--></p>

<p>One guy was different.</p>

<p>I had noticed him getting on earlier. Not exactly sure what it was, but something suggested there was a problem. This guy looked like a pretty normal construction worker on his way home. Work boots with leather missing over the steel toes. Dusty clothes. Dirty face. Pretty normal stuff.</p>

<p>But something was off.</p>

<p>He took a seat near the front. This was just after the bus turns on to Granville and there was still space left. By the end of Granville it’s standing room only folks. This guy immediately started to nod off.</p>

<p>I’m not sure if you’ve experienced this but there is a difference between people who fall asleep because they are hot, bored, and tired, and people who are passing out. People the former camp will fight it. Head bouncing up and down. Shifting in their seat. Looking around. Yawning. People in the second camp … just pass out. This guy was passed out, fast.</p>

<p>Okay, so the guy had a couple of drinks after work. Taking the bus home rather than driving. Not the first time I’d seen it on the bus. Commendable. Right?</p>

<p>By the time we got to Davie Street things had changed. The guy was not responding and had half fallen out of his chair. I had stopped watching him by this point because I was all the way in the back and there were many people standing in the isle. A lady grabbed the driver’s attention. The driver stopped the bus and tried to get the guy to respond without success. Verbal and physical queues were having no impact. The driver called the ambulance on the radio and asked everyone to get off the bus. I was one of the last people to step off.</p>

<p>The last thing I saw from within the bus was the lady and bus driver trying without success to wake the man. He was laid out on the floor of a bus with two strangers looking down at him watching him die. There was nothing I could do.</p>

<p>.</p>

<p>.</p>

<p>.</p>

<p>Around this time the Canadian and BC governments started handing out Naloxone kits. Naloxone is an injectable opioid antagonist. It binds to opioids that have blocked receptors in the brain and knocks them free. And it works fast - scary fast. And the side effects are minimal so it’s safe to inject even if you don’t have full confirmation that the patient is overdosing on opioid.</p>

<p>Given my experience I just couldn’t sit by. I took the online course. Then stopped at the London Drugs downtown. A quick couple of questions and I’m off with my kit.</p>

<p>.</p>

<p>.</p>

<p>.</p>

<p>That kit has sat unused in my backpack for years. Right beside my small first aid kit. Neither take much room. And I’d rather have it and never use it.</p>

<p>It’s become apparent to me that the opioid crisis is not a crisis of status or money or opportunity. It’s an equal opportunity problem. People are getting hooked for many reasons. Once hooked in, it’s a hard one to shake. So my thinking is simple. Anyone, at any time could have an issue. If I can help just by carrying the kit and being close at hand, it costs me nothing.</p>

<p>.</p>

<p>.</p>

<p>.</p>

<p>A couple of months ago I was very tired after the drive in and coming down the elevator of the Bay Parkade, decided to get some Tim’s for breakfast. This is not something I do.</p>

<p>As I passed the driveway past the parkade and neared the old RadioShack building, I noticed a small group of people. It quickly became clear that one person was giving another CPR.</p>

<p>Two Vancouver Downtown Ambassadors were giving aid to a guy who had obviously been sleeping rough. The second Ambassador was watching. This looked like a classic overdose to me. As I approached, I asked if they had administered Naloxone. His reply stunned me. They were barred from administering Naloxone. But don’t worry they had called for an ambulance. WTF! You can give CPR/Mouth-to-mouth but not Naloxone. In downtown Vancouver? Blocks away from the center of the opioid epidemic in Canada?</p>

<p>I dropped my bag and rummaged around for my kit. I had just gotten my gloves on when one of the quick response trucks pulled up. First responders piled out. Much better equipped than I. I slipped my kit back together into my bag and kept on with my day.</p>

<p>.</p>

<p>.</p>

<p>.</p>

<p>I carry a naloxone kit in my backpack.</p>

<p>I don’t use opioids.</p>

<p>I don’t intend to use opioids.</p>

<p>But that’s not the point.</p>

<p><a href="https://www.canada.ca/en/health-canada/services/opioids/naloxone.html">Naloxone kit information.</a></p>]]></content><author><name>Dean Giberson</name><email>dean@deangiberson.com</email></author><summary type="html"><![CDATA[I carry a naloxone kit in my backpack. I don’t use opioids. I don’t intend to use opioids. But that’s not the point. . . . In the summer of 2019 I was on the 7 heading home from Downtown to the Kitsilano apartment I shared with my wife. It was a perfectly normal day on transit. Hot. Stagnant air. Sweaty people. Stop and go from stop to stop on Granville Street. The whine of the electric bus. The clack-clack of the trolley bar on the overhead cables. People were zoning out.]]></summary></entry><entry><title type="html">not going to be able to kill your way out of this</title><link href="/2024/07/06/not-going-to-be-able-to-kill-your-way-out-of-this.html" rel="alternate" type="text/html" title="not going to be able to kill your way out of this" /><published>2024-07-06T00:00:00-07:00</published><updated>2024-07-06T00:00:00-07:00</updated><id>/2024/07/06/not-going-to-be-able-to-kill-your-way-out-of-this</id><content type="html" xml:base="/2024/07/06/not-going-to-be-able-to-kill-your-way-out-of-this.html"><![CDATA[<p>I was listening to the Freakonomics Radio podcast backlog this week. The episode, <a href="https://freakonomics.com/podcast/can-55-billion-end-the-opioid-epidemic/">Can $55 Billion End the Opioid Epidemic?</a> was about the opioid crisis and how to deal with it with a frame on the payouts from legal wins. The interviewee, Stephen Loyd, was responding to a question Stephen Dubner asked about what if we just focused on prevention and not treatment. His response was, “… you’re really not going to be able to kill your way out of this …” Essentially, opioid use has such high impacts that it has social contagion impacts that grow faster than people are killed by its use. People get addicted faster that people leave addiction.</p>

<p>I’m reminded of all the people that have been dying on the <a href="https://www.crackdownpod.com/">Crackdown</a> podcast.</p>

<p>If you’ve not heard it, Crackdown is a ground level opinion show about people in the drug crisis from the perspective of drug users. Listening to it puts a human spin on the reporting through other channels. I recommend giving it a go.</p>

<p>I hear about people dying of opioid overdose. About the toxic drug supply. About mental health crisis. I drive through Hastings and Main regularly on my way to and from work. I see the effects in Vancouver and Maple Ridge. I see the people hiding from the weather between cars in the Bay Parkade. I just couldn’t understand how this problem was self sustaining.</p>

<p>That one quote, “you’re really not going to be able to kill your way out of this.” summed everything up for me. We having been expecting the problem to go away, because eventually we had to run out of people who would become addicted to opioids. This one will not go away on its own. It’s been going for 25 years. Half my life. And it’s only getting worse.</p>]]></content><author><name>Dean Giberson</name><email>dean@deangiberson.com</email></author><summary type="html"><![CDATA[I was listening to the Freakonomics Radio podcast backlog this week. The episode, Can $55 Billion End the Opioid Epidemic? was about the opioid crisis and how to deal with it with a frame on the payouts from legal wins. The interviewee, Stephen Loyd, was responding to a question Stephen Dubner asked about what if we just focused on prevention and not treatment. His response was, “… you’re really not going to be able to kill your way out of this …” Essentially, opioid use has such high impacts that it has social contagion impacts that grow faster than people are killed by its use. People get addicted faster that people leave addiction.]]></summary></entry><entry><title type="html">Media Monday - The Program Audio Series</title><link href="/2024/04/22/media-monday-the-program-audio-series.html" rel="alternate" type="text/html" title="Media Monday - The Program Audio Series" /><published>2024-04-22T00:00:00-07:00</published><updated>2024-04-22T00:00:00-07:00</updated><id>/2024/04/22/media-monday-the-program-audio-series</id><content type="html" xml:base="/2024/04/22/media-monday-the-program-audio-series.html"><![CDATA[<p>Today I’d like to talk about <a href="https://programaudioseries.com/">The Program Audio Series</a>. The Program is about post singularity humanity told from the survivors. Only, I don’t think you are expecting this.</p>

<p><img src="/assets/images/the-program-audio-series-logo.svg" alt="" />
<!--more--></p>

<p>Imagine a mixture between Necromancer and Tales from the Loop as a regular podcast. Yes, AI has taken over the world, but what if they only wanted to make everyone happy? And what if happy was a relative term that meant other people couldn’t operate correctly in the world at all?</p>

<p>The Program tells a series of tales which are interwoven, but are individual on their own. They share a common idea of post singularity, AI run are real and run everything, and have a common thread running through them, like the algorithms, but there is no agreement that they are part of the same universe. In fact in at least one case it’s confirmed that the story is being told from a simulation of reality.</p>]]></content><author><name>Dean Giberson</name><email>dean@deangiberson.com</email></author><category term="media monday" /><summary type="html"><![CDATA[Today I’d like to talk about The Program Audio Series. The Program is about post singularity humanity told from the survivors. Only, I don’t think you are expecting this.]]></summary></entry><entry><title type="html">Media Monday - Fallout</title><link href="/2024/04/15/media-monday-fallout.html" rel="alternate" type="text/html" title="Media Monday - Fallout" /><published>2024-04-15T00:00:00-07:00</published><updated>2024-04-15T00:00:00-07:00</updated><id>/2024/04/15/media-monday-fallout</id><content type="html" xml:base="/2024/04/15/media-monday-fallout.html"><![CDATA[<p>Given my history with games, interest in power armor, and an attraction to over the top shows, of course I’m watching Fallout.
<!--more-->
Fallout is a new series streaming on Prime now. It’s based on the series of games by Bethesda Games. I’ve played all but the MMORPG (Fallout 76) and the latest stand alone (Fallout 4). Many hours were spent playing Fallout 3.</p>

<p>One of the key elements of the franchise in recent games is the mixture of 50’s nostalgia and music. Several key product design exist in the world that are specific to the story. Nuka cola is a great example. Imagine a Coke/Pespi brand that uses the image of a rocket and impending nuclear holocaust as it’s core. These elements were central to creating a central world story.</p>

<p>The TV show borrows heavily from this. So much so that I felt like the first two episodes were just spot the reference games. It wasn’t until the end of the second episode and into the third that it settled down and started telling it’s own story.</p>

<p>In general, if you  like the games. You will like the show. Otherwise, fans of SyFi style lite character based stories will find a fun introduction to the world.</p>

<p><img src="/assets/images/fallout_poster.jpg" alt="Promotional poster for a new series titled 'Fallout' coming to Prime on April 12. The central figure is a person wearing a blue jumpsuit with the number 33 on the back, adorned with orange shoulder pads. They are looking out towards a desolate, post-apocalyptic landscape through a large, broken circular vault door. Ruins of a ferris wheel and dilapidated buildings under a cloudy sky can be seen in the distance, alongside the faded neon signs. The bold, yellow 'Fallout' title is at the bottom with the Prime logo and release date." /></p>]]></content><author><name>Dean Giberson</name><email>dean@deangiberson.com</email></author><category term="media monday" /><summary type="html"><![CDATA[Given my history with games, interest in power armor, and an attraction to over the top shows, of course I’m watching Fallout. Fallout is a new series streaming on Prime now. It’s based on the series of games by Bethesda Games. I’ve played all but the MMORPG (Fallout 76) and the latest stand alone (Fallout 4). Many hours were spent playing Fallout 3.]]></summary></entry><entry><title type="html">Media Monday - Godzilla x King Kong / Dune 2</title><link href="/2024/04/08/media-monday-godzilla-x-king-kong-dune-2.html" rel="alternate" type="text/html" title="Media Monday - Godzilla x King Kong / Dune 2" /><published>2024-04-08T00:00:00-07:00</published><updated>2024-04-08T00:00:00-07:00</updated><id>/2024/04/08/media-monday-godzilla-x-king-kong-dune-2</id><content type="html" xml:base="/2024/04/08/media-monday-godzilla-x-king-kong-dune-2.html"><![CDATA[<p>I went to the drive-in to see Godzilla x King Kong: The New Empire paired with Dune 2 on the weekend. Both movies were a fun to watch.
<!--more--></p>

<p>Godzilla x King Kong: The New Empire was just what you would expect, a straight up monster movie. Lots of monster fights and things flying everywhere. It’s great how they have kept the feel of the rubber suits while making it modern. At no point does this movie take itself too seriously. Just sit back and enjoy the fine cheese.</p>

<p>I will say that this has made me interested in the reboot of Godzilla. I had been avoiding it, thinking myself a Godzilla purist. I think I need to revisit that stance and give the series a chance.</p>

<p>Dune 2. Wow, what a movie. It’s amazing how they took the disjointed scenes from the book and sewed them together in the movie. It still just a bunch of vignettes, stretched across time as Paul gathers his power base. It’s almost a montage sequence. But it’s shown together in such a way to make it clear what’s happening and give you a view into the mind of the characters.</p>

<p>I took my daughter to the Twilight Drive-in. Looks like it might be the last movies we go see there. At the end of the season they are shutting down. It’s just not profitable, and taxes for the value of the land are hurting them. Sad to see. Drive-ins are something that I grew up with, but peoples tastes have changed. The Twilight was mostly full, not the fullest I’ve seen it in the 20-years I’ve been going, but enough that there were only a few spot very near or far from the screen left. It’s hard to see things like this getting priced out of existence.</p>

<p>If you are in the Vancouver are, I recommend trying to get out to the Twilight one last time. I think you will enjoy it.</p>]]></content><author><name>Dean Giberson</name><email>dean@deangiberson.com</email></author><category term="media monday" /><summary type="html"><![CDATA[I went to the drive-in to see Godzilla x King Kong: The New Empire paired with Dune 2 on the weekend. Both movies were a fun to watch.]]></summary></entry><entry><title type="html">Media Monday - Androne</title><link href="/2024/04/01/media-monday-androne.html" rel="alternate" type="text/html" title="Media Monday - Androne" /><published>2024-04-01T00:00:00-07:00</published><updated>2024-04-01T00:00:00-07:00</updated><id>/2024/04/01/media-monday-androne</id><content type="html" xml:base="/2024/04/01/media-monday-androne.html"><![CDATA[<p>I just finished reading Androne by <a href="https://www.dwainworrell.com/books">Dwain Worrell</a>. It started a little slow, but ramps up to a great conclusion.
<!--more--></p>

<p>The story follows Paxton Arés who was injured in a surprise global attack on all militaries. Paxton has reenlisted as an Androne pilot. Androne are a portmanteau of android and drone. Think long distance battle bots, a favourite genre of mine. 😏</p>

<p>While you may try to guess who the enemy are in this story, I would bet it’s not you first, second, or maybe even your third guess.</p>

<p>If you are interested at all in future warfare, drone warfare, robot battles, I would recommend this as a book to read. I’ve already pre-ordered the sequel.</p>]]></content><author><name>Dean Giberson</name><email>dean@deangiberson.com</email></author><category term="media monday" /><summary type="html"><![CDATA[I just finished reading Androne by Dwain Worrell. It started a little slow, but ramps up to a great conclusion.]]></summary></entry><entry><title type="html">Media Monday - Desert Skies</title><link href="/2024/03/25/media-monday-desert-skies.html" rel="alternate" type="text/html" title="Media Monday - Desert Skies" /><published>2024-03-25T00:00:00-07:00</published><updated>2024-03-25T00:00:00-07:00</updated><id>/2024/03/25/media-monday-desert-skies</id><content type="html" xml:base="/2024/03/25/media-monday-desert-skies.html"><![CDATA[<p>Over the weekend I binged the wonderful podcast <a href="https://desertskiespodcast.com/">Desert Skies</a>. I was initially pulled in by the Welcome to Nightvale-like lone gas station thumbnail. I’m glad was. I’m also glad that there is nothing in common.
<!--more-->
Desert Skies is a story set in the astral plane. The first stop for newly dead people is a lone gas station on an empty highway. Here they receive directions and assistance in their journey. What makes this podcast work is that is re-imagines all of the tired tropes of death and astral projection into a new, fresh, and humorous direction.</p>

<p>The character cast starts small with three main characters and one newly dead character. Which is good because the podcast creator, Jared Carter, does all of the voice work himself.</p>

<p>I recommend Desert Skies as a fun, but thought provoking romp through the hereafter. The first season is complete and the second is planned for 2024.</p>]]></content><author><name>Dean Giberson</name><email>dean@deangiberson.com</email></author><category term="media monday" /><summary type="html"><![CDATA[Over the weekend I binged the wonderful podcast Desert Skies. I was initially pulled in by the Welcome to Nightvale-like lone gas station thumbnail. I’m glad was. I’m also glad that there is nothing in common. Desert Skies is a story set in the astral plane. The first stop for newly dead people is a lone gas station on an empty highway. Here they receive directions and assistance in their journey. What makes this podcast work is that is re-imagines all of the tired tropes of death and astral projection into a new, fresh, and humorous direction.]]></summary></entry><entry><title type="html">2024 Daily journal template</title><link href="/2024/01/02/2024-daily-journal-template.html" rel="alternate" type="text/html" title="2024 Daily journal template" /><published>2024-01-02T00:00:00-08:00</published><updated>2024-01-02T00:00:00-08:00</updated><id>/2024/01/02/2024-daily-journal-template</id><content type="html" xml:base="/2024/01/02/2024-daily-journal-template.html"><![CDATA[<p>First day back to work after the holidays. It being a new year meant updating my daily journal template. I use Noteshelf 3 on my iPad to take all of my notes. There are many alternatives, this is the one that feels right for me.</p>

<p>My template uses a three column layout. In the left hand column, I have a set of a few questions I ask myself in the morning to get myself centered. The right hand column are for details and questions that I address at the end of the day. I leave most of the center open for notes.</p>

<p><img src="/assets/images/Daily Journal 2024 Page Template.png" alt="2023 Daily Journal Template" /></p>

<p>To start my day I take the question I thought of the day before and put it in the top left of the page. Often I have already a kernel of an answer after sleeping on it. I then take a moment to focus on gratitude (not everyone’s cup of tea, but important for my mental well being). Next I outline what a good day would look like. I try to really look for a positive outcome, but often just settle for a non-crappy one. Then I outline the one thing I need to get done for the day. It’s too easy for me to get caught up in the moment to moment issues, this makes it easy for me to see at a glance what I’ve decided must be done.</p>

<p>At the end of the day I take time to capture my accomplishments, as it’s important to recognize progress. Then I take stock of my feelings. Often there is something reoccuring that can only be noticed if you write it down and see it repeated. Then I document the things I read, and I read a lot. And, as a balance to the how to make things great I have how it could have been better.</p>

<p>I try to document three good decisions. It’s important as a person in a leadership position to be making good decision. This doesn’t mean they have to come completely from you. Often, good decisions come from hearing what others are trying to tell you. This is a chance for me to review my actions and make sure I’m on the right track. If I identify anything here that needs to be fixed, it’s easier to address it the next day, rather than days/weeks/months later.</p>

<p>Finally, I set out the question that needs to be answered.</p>

<p>I don’t follow this religiously, but I’ve found that these sets of questions, regularly observed, help me stay on track. What do you do for taking notes? What questions do you regularly ask yourself?</p>

<p>A PDF template can be downloaded <a href="/assets/images/Daily Journal 2024 Page Template.pdf">here</a>.</p>]]></content><author><name>Dean Giberson</name><email>dean@deangiberson.com</email></author><summary type="html"><![CDATA[First day back to work after the holidays. It being a new year meant updating my daily journal template. I use Noteshelf 3 on my iPad to take all of my notes. There are many alternatives, this is the one that feels right for me.]]></summary></entry><entry><title type="html">2024 - Happy New Year</title><link href="/ramble/2024/01/01/2024-happy-new-year.html" rel="alternate" type="text/html" title="2024 - Happy New Year" /><published>2024-01-01T00:00:00-08:00</published><updated>2024-01-01T00:00:00-08:00</updated><id>/ramble/2024/01/01/2024-happy-new-year</id><content type="html" xml:base="/ramble/2024/01/01/2024-happy-new-year.html"><![CDATA[<p>It’s the beginning of a new year, and I want to take some time to outline the things I want for myself in the new year.</p>

<p>One thing is I want to get back into drawing, specifically comics. I had started to draw comics a few years ago before my daughters were born, but dropped it in favour of being a dad. Now they are at an age where they don’t always need me around. This gives me a little more time. Expect to see more visual art as part of my work.</p>

<p>All over the news is the move to public domain of <a href="https://archive.org/details/steamboat-willie-mickey">Steamboat Willie</a>. I’ve grown in the time where it seemed that this was never going to happen. having this content move into public domain seemed so far away, and was always moved further still. Disney just owned everything, and they were going to ensure that keeping that locked up would go forever. When I briefly went to work for Disney on Tron: Evolution, one of the things that you are shown is an orientation video about how Disney wants to continue to make content that spans the world. At one point in the video they talk about a Planet Disney. Even showing a Fifth Element like space liner and a Mickey Mouse eared satellite (mandella effect?). I’m not 100% sure that this is an allegory. Given the chance they would terraform a planet to turn into the next Disney World.</p>

<p>But now, here we are. I hope to see a lot of great new works created because we finally allowing more works to pass into the public domain. Not just derivative works, but new ideas. If you’ve not seen it check out <a href="https://boingboing.net/2024/01/01/meet-tom-the-dancing-bugs-newest-character-mickey-mouse.html">Tom the Dancing Bug for Jan 1, 2024</a></p>

<p>And, of course, I can’t let the opportunity go by.</p>

<p><img src="/assets/images/2024-01-01-steamboat-willie.png" alt="Quick Steamboat Willie sketch" /></p>

<p>Let’s not stop at Steamboat Willie</p>]]></content><author><name>Dean Giberson</name><email>dean@deangiberson.com</email></author><category term="ramble" /><summary type="html"><![CDATA[It’s the beginning of a new year, and I want to take some time to outline the things I want for myself in the new year.]]></summary></entry><entry><title type="html">Create Docker Container</title><link href="/chatgpt-experiment/2023/07/18/create-docker-container-plan.html" rel="alternate" type="text/html" title="Create Docker Container" /><published>2023-07-18T21:55:54-07:00</published><updated>2023-07-18T21:55:54-07:00</updated><id>/chatgpt-experiment/2023/07/18/create-docker-container-plan</id><content type="html" xml:base="/chatgpt-experiment/2023/07/18/create-docker-container-plan.html"><![CDATA[<p>Up until now we have been putting together infrastructure to run the application on. We will now get to building the root of the application. I start by breaking out the task for creating a docker container into it’s own task. To do that I ask the following of ChatGPT, <code class="language-plaintext highlighter-rouge">I would like to work on Master Plan Step 1 - "Create a Docker container for running your application." I will be building the application from a laptop. Break this task down into simple steps that I can follow. Refer to this task list as the "Create Docker Container Plan".</code></p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>Sure, let's break down the "Create a Docker container for running your
application" task into a step-by-step plan, which we'll refer to as
the "Create Docker Container Plan":

1. **Prepare Your Application:**
   - Ensure your application is ready for containerization. It should
     be in a directory with all necessary files and dependencies.

2. **Install Docker:**
   - Make sure Docker is installed on your laptop. You can download
     and install Docker Desktop for Windows or macOS, or Docker Engine
     for Linux.

3. **Write a Dockerfile:**
   - Create a `Dockerfile` in the root directory of your
     application. The `Dockerfile` is a text file that contains
     instructions to build the Docker image for your application.

4. **Choose a Base Image:**
   - Decide on a suitable base image for your application. This image
     will provide the foundation for your Docker container. Common
     choices include official language-specific images (e.g., Python,
     Node.js) or lightweight Alpine Linux images.

5. **Copy Application Files:**
   - Use the `COPY` instruction in your `Dockerfile` to copy your
     application files from the local directory to the Docker image.

6. **Install Dependencies:**
   - If your application has any dependencies, use the appropriate
     package manager in your `Dockerfile` (e.g., `pip`, `npm`, `yarn`)
     to install them inside the Docker image.

7. **Expose Ports (if needed):**
   - If your application needs to listen on specific ports for
     communication, use the `EXPOSE` instruction in your `Dockerfile`
     to specify the port(s) to be exposed.

8. **Set the Startup Command:**
   - Use the `CMD` or `ENTRYPOINT` instruction in your `Dockerfile` to
     specify the command that will run when the container starts. This
     command should start your application.

9. **Build the Docker Image:**
   - Open a terminal or command prompt, navigate to your application's
	 directory, and run the command to build the Docker image using
	 the `Dockerfile`. For example:
     
     docker build -t your-image-name .
     
10. **Verify the Docker Image:**
    - After the image is built, verify that it includes all the
      necessary files and dependencies by running a new container
      based on this image locally.

11. **Test Your Application:**
    - Launch a container from the built image and verify that your
      application runs as expected within the container.

12. **Push the Docker Image (Optional):**
    - If you have a Docker Hub account (or any other container
      registry), you can push your Docker image to the registry so
      that it can be accessed and deployed on other systems.

With the "Create Docker Container Plan," you can containerize your
application, making it easier to run consistently on different
environments, including your Digital Ocean instance. Each step
provides incremental progress towards successfully building and
deploying your Docker container.
</code></pre></div></div>

<p>This makes sense, however I don’t have an application. These steps
only tell me how to package it together into a Docker container. I
think I need to ask ChatGPT to build this application for me now. <code class="language-plaintext highlighter-rouge">I
need more details for the first step of the Create Docker Container
Plan. Please provide me with a simple Python based application using
Flask that will respond to a deep health check request. It will
respond with JSON if the application is healthy.</code></p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>Sure! Here's a simple Python-based application using Flask that will
respond to a deep health check request with JSON if the application is
healthy:

1. **Prepare Your Application:**

First, create a new directory for your Flask application and navigate
to it in your terminal.

2. **Create a Python File:**

Create a new Python file (e.g., `app.py`) in the directory you just
created.

3. **Install Flask:**

Make sure you have Flask installed in your Python environment. If you
don't have it installed, you can install it using `pip`:
</code></pre></div></div>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>pip <span class="nb">install </span>Flask
</code></pre></div></div>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>4. **Write the Flask Application:**

In the `app.py` file, add the following code to create a Flask
application:
</code></pre></div></div>
<div class="language-python highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="kn">from</span> <span class="n">flask</span> <span class="kn">import</span> <span class="n">Flask</span><span class="p">,</span> <span class="n">jsonify</span>

<span class="n">app</span> <span class="o">=</span> <span class="nc">Flask</span><span class="p">(</span><span class="n">__name__</span><span class="p">)</span>

<span class="nd">@app.route</span><span class="p">(</span><span class="sh">'</span><span class="s">/</span><span class="sh">'</span><span class="p">)</span>
<span class="k">def</span> <span class="nf">hello</span><span class="p">():</span>
    <span class="k">return</span> <span class="sh">'</span><span class="s">Hello, World!</span><span class="sh">'</span>

<span class="nd">@app.route</span><span class="p">(</span><span class="sh">'</span><span class="s">/health</span><span class="sh">'</span><span class="p">)</span>
<span class="k">def</span> <span class="nf">health_check</span><span class="p">():</span>
    <span class="c1"># Perform health check logic here (e.g., check database connection, dependencies, etc.)
</span>    <span class="c1"># If the application is healthy, respond with a JSON indicating its health status.
</span>    <span class="n">health_status</span> <span class="o">=</span> <span class="p">{</span>
        <span class="sh">"</span><span class="s">status</span><span class="sh">"</span><span class="p">:</span> <span class="sh">"</span><span class="s">healthy</span><span class="sh">"</span><span class="p">,</span>
        <span class="sh">"</span><span class="s">message</span><span class="sh">"</span><span class="p">:</span> <span class="sh">"</span><span class="s">Application is running smoothly.</span><span class="sh">"</span>
    <span class="p">}</span>
    <span class="k">return</span> <span class="nf">jsonify</span><span class="p">(</span><span class="n">health_status</span><span class="p">)</span>

<span class="k">if</span> <span class="n">__name__</span> <span class="o">==</span> <span class="sh">'</span><span class="s">__main__</span><span class="sh">'</span><span class="p">:</span>
    <span class="n">app</span><span class="p">.</span><span class="nf">run</span><span class="p">(</span><span class="n">host</span><span class="o">=</span><span class="sh">'</span><span class="s">0.0.0.0</span><span class="sh">'</span><span class="p">,</span> <span class="n">port</span><span class="o">=</span><span class="mi">5000</span><span class="p">)</span>
</code></pre></div></div>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>5. **Run the Flask Application:**

To test the Flask application locally, run the following command in
your terminal:
</code></pre></div></div>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>python app.py
</code></pre></div></div>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>This will start the Flask development server, and you can access your
application at `http://localhost:5000/`.

6. **Deep Health Check Request:**

To perform a deep health check on your Flask application, you can make
an HTTP GET request to the `/health` endpoint:
</code></pre></div></div>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>curl http://localhost:5000/health
</code></pre></div></div>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>You should receive a JSON response indicating that the application is
healthy, like this:
</code></pre></div></div>
<div class="language-json highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="p">{</span><span class="w">
    </span><span class="nl">"status"</span><span class="p">:</span><span class="w"> </span><span class="s2">"healthy"</span><span class="p">,</span><span class="w">
    </span><span class="nl">"message"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Application is running smoothly."</span><span class="w">
</span><span class="p">}</span><span class="w">
</span></code></pre></div></div>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>This simple Flask application responds to the `/health` endpoint with
a JSON message when the application is healthy. You can modify the
`health_check` function to add more complex health checks based on
your application's requirements, such as checking database
connections, external service dependencies, or other critical
components.
</code></pre></div></div>

<p>This looks reasonable except for the fact that I think that using a
virtual env would be best. <code class="language-plaintext highlighter-rouge">Modify this task list to add the use of a
virtual env to make working with Python easier.</code></p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>Absolutely! Using a virtual environment is a good practice in Python
development to manage dependencies and keep your project
isolated. Here's the updated "Create Docker Container Plan" with the
addition of setting up a virtual environment:

1. **Prepare Your Application:**
   - Create a new directory for your Flask application and navigate to
     it in your terminal.

2. **Set Up a Virtual Environment:**
   - Create a virtual environment within your application directory to
     manage Python dependencies.

   On macOS/Linux:
</code></pre></div></div>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>   python3 <span class="nt">-m</span> venv venv
   <span class="nb">source </span>venv/bin/activate
</code></pre></div></div>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>   On Windows:
</code></pre></div></div>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>   python <span class="nt">-m</span> venv venv
   venv<span class="se">\S</span>cripts<span class="se">\a</span>ctivate
</code></pre></div></div>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>3. **Install Flask and Dependencies:**
   - With the virtual environment activated, install Flask and any
     other required dependencies using `pip`.
</code></pre></div></div>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>   pip <span class="nb">install </span>Flask
</code></pre></div></div>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>4. **Create a Python File:**
   - Create a new Python file (e.g., `app.py`) in the application
     directory.

5. **Write the Flask Application:**
   - In the `app.py` file, add the Python code to create a Flask
     application.

6. **Run the Flask Application:**
   - Test the Flask application locally with the virtual environment
     activated.
</code></pre></div></div>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>   python app.py
</code></pre></div></div>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>7. **Deep Health Check Request:**
   - Perform a deep health check on your Flask application by making
     an HTTP GET request to the `/health` endpoint.
</code></pre></div></div>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>   curl http://localhost:5000/health
</code></pre></div></div>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>   You should receive a JSON response indicating that the application
   is healthy.

8. **Dockerize the Application:**
   - Write a `Dockerfile` in the root directory of your application to
     containerize the Flask application.

9. **Build the Docker Image:**
   - Open a terminal or command prompt, navigate to your application's
     directory, and build the Docker image using the `Dockerfile`.
</code></pre></div></div>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>   docker build <span class="nt">-t</span> your-image-name <span class="nb">.</span>
</code></pre></div></div>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>10. **Verify the Docker Image:**
    - After the image is built, verify that it includes all the
      necessary files and dependencies by running a new container
      based on this image locally.

11. **Test Your Application in the Docker Container:**
    - Launch a container from the built image and verify that your
      application runs as expected within the container.

12. **Push the Docker Image (Optional):**
    - If you have a Docker Hub account (or any other container
      registry), you can push your Docker image to the registry so
      that it can be accessed and deployed on other systems.

By using a virtual environment, you can manage Python dependencies
separately for each project, ensuring that the required packages are
isolated and don't interfere with other projects on your laptop. This
approach enhances the reproducibility and maintainability of your
Python applications.
</code></pre></div></div>

<p>This is a step better but still misses the critical piece of
information – what is the application code. <code class="language-plaintext highlighter-rouge">What are the contents of
the app.py file in step 5?</code></p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>Apologies for the oversight in my previous responses. In Step 5, the
`app.py` file should contain the code for your Flask application,
including the routes for the root (`/`) and health (`/health`)
endpoints. Here's the correct content of the `app.py` file:
</code></pre></div></div>
<div class="language-python highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="kn">from</span> <span class="n">flask</span> <span class="kn">import</span> <span class="n">Flask</span><span class="p">,</span> <span class="n">jsonify</span>

<span class="n">app</span> <span class="o">=</span> <span class="nc">Flask</span><span class="p">(</span><span class="n">__name__</span><span class="p">)</span>

<span class="nd">@app.route</span><span class="p">(</span><span class="sh">'</span><span class="s">/</span><span class="sh">'</span><span class="p">)</span>
<span class="k">def</span> <span class="nf">hello</span><span class="p">():</span>
    <span class="k">return</span> <span class="sh">'</span><span class="s">Hello, World!</span><span class="sh">'</span>

<span class="nd">@app.route</span><span class="p">(</span><span class="sh">'</span><span class="s">/health</span><span class="sh">'</span><span class="p">)</span>
<span class="k">def</span> <span class="nf">health_check</span><span class="p">():</span>
    <span class="c1"># Perform health check logic here (e.g., check database connection, dependencies, etc.)
</span>    <span class="c1"># If the application is healthy, respond with a JSON indicating its health status.
</span>    <span class="n">health_status</span> <span class="o">=</span> <span class="p">{</span>
        <span class="sh">"</span><span class="s">status</span><span class="sh">"</span><span class="p">:</span> <span class="sh">"</span><span class="s">healthy</span><span class="sh">"</span><span class="p">,</span>
        <span class="sh">"</span><span class="s">message</span><span class="sh">"</span><span class="p">:</span> <span class="sh">"</span><span class="s">Application is running smoothly.</span><span class="sh">"</span>
    <span class="p">}</span>
    <span class="k">return</span> <span class="nf">jsonify</span><span class="p">(</span><span class="n">health_status</span><span class="p">)</span>

<span class="k">if</span> <span class="n">__name__</span> <span class="o">==</span> <span class="sh">'</span><span class="s">__main__</span><span class="sh">'</span><span class="p">:</span>
    <span class="n">app</span><span class="p">.</span><span class="nf">run</span><span class="p">(</span><span class="n">host</span><span class="o">=</span><span class="sh">'</span><span class="s">0.0.0.0</span><span class="sh">'</span><span class="p">,</span> <span class="n">port</span><span class="o">=</span><span class="mi">5000</span><span class="p">)</span>
</code></pre></div></div>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>This code sets up a basic Flask application with two routes:

1. The `'/'` route responds with the string `'Hello, World!'` when
   accessed. You can customize this route to handle other requests or
   render HTML templates for more complex applications.

2. The `'/health'` route handles the deep health check request. In
   this example, it responds with a JSON message indicating that the
   application is healthy. You can add more complex health check logic
   to this route, depending on your application's needs.

Please use this updated content for your `app.py` file when working on
Step 5 of the "Create Docker Container Plan."
</code></pre></div></div>

<p>This is working. The application works as you would expect. <code class="language-plaintext highlighter-rouge">Now, what
are the contents of the Dockerfile in Step 8?</code></p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>Sure! In Step 8, the `Dockerfile` is used to define the instructions
for building the Docker image for your Flask application. Here's the
content of the `Dockerfile`:
</code></pre></div></div>
<div class="language-Dockerfile highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c"># Use a base image with Python installed</span>
<span class="k">FROM</span><span class="s"> python:3.9-slim</span>

<span class="c"># Set the working directory inside the container</span>
<span class="k">WORKDIR</span><span class="s"> /app</span>

<span class="c"># Copy the application files to the container's working directory</span>
<span class="k">COPY</span><span class="s"> app.py /app/app.py</span>

<span class="c"># Install Flask and any other required dependencies</span>
<span class="k">RUN </span>pip <span class="nb">install </span>Flask

<span class="c"># Expose port 5000 (the same port we specified in app.py)</span>
<span class="k">EXPOSE</span><span class="s"> 5000</span>

<span class="c"># Set the startup command to run the Flask application</span>
<span class="k">CMD</span><span class="s"> ["python", "app.py"]</span>
</code></pre></div></div>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>Explanation of the Dockerfile contents:

- `FROM python:3.9-slim`: This line specifies the base image to use
  for building your Docker image. We're using the official Python 3.9
  slim image as our base, which includes only essential packages to
  minimize the image size.

- `WORKDIR /app`: This sets the working directory inside the container
  to `/app`. This is where our application code will be copied.

- `COPY app.py /app/app.py`: This line copies the `app.py` file from
  the current directory (where the Dockerfile resides) to the `/app`
  directory inside the container.

- `RUN pip install Flask`: This command installs Flask and any other
  required dependencies inside the container. It's good practice to
  separate the installation of dependencies from copying the
  application code to leverage Docker's layer caching for faster
  builds.

- `EXPOSE 5000`: This line exposes port 5000, which is the port our
  Flask application will be running on. This is necessary so that
  external services can communicate with the application running in
  the container.

- `CMD ["python", "app.py"]`: This specifies the command that will be
  executed when the container starts. In this case, it runs the
  `app.py` file using the Python interpreter, which will start the
  Flask application.

With this Dockerfile, you can now build a Docker image containing your
Flask application using the `docker build` command as mentioned in
Step 9 of the "Create Docker Container Plan."
</code></pre></div></div>

<p>Continuing I build the Docker image. But I don’t want to have to
remember the magic sauce so I write a quick build script.</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c">#!/bin/sh</span>
<span class="nb">set</span> <span class="nt">-ex</span>
docker build <span class="nt">-t</span> manager-blind-spot-application-server <span class="nb">.</span>
</code></pre></div></div>

<p>This quickly builds the Docker image for me. Then I can run the Docker
image. I’m trying to think like someone who’s never done this before
and so I ask ChatGPT. <code class="language-plaintext highlighter-rouge">How do I run the docker image
your-image-name?</code></p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>To run the Docker image you built with the tag `your-image-name`, you can use the `docker run` command. Here's the command to run the Docker image:
</code></pre></div></div>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>docker run <span class="nt">-p</span> 5000:5000 your-image-name
</code></pre></div></div>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>Let's break down the options used in the `docker run` command:

- `-p 5000:5000`: This option maps port 5000 from the container to
  port 5000 on your host machine. This is necessary to access your
  Flask application running inside the container.

- `your-image-name`: Replace this with the actual name you gave to
  your Docker image when you built it. For example, if you used
  `docker build -t my-flask-app .`, then the image name would be
  `my-flask-app`.

After running the `docker run` command, your Flask application will be
running inside the Docker container. You can access it from your host
machine by visiting `http://localhost:5000/` in your web browser.

Keep in mind that if your Flask application needs to access any
external resources, such as a database or other services, you might
need to set up additional networking options or environment variables
to connect to those resources from within the container. But for a
basic Flask application, the above command should work fine to run it
in the Docker container.
</code></pre></div></div>

<p>One thing to notice is that ChatGPT is very verbose. This would be
helpful for people that have little experience. Not sure I like it but
that’s not the point of this exercise. Again, I want to write all of
this down so that tired me six months from now doesn’t need to
remember anything. So I write a run script. One thing to note is I’ve
named my application <code class="language-plaintext highlighter-rouge">manager-blind-spot-application-server</code>.</p>

<p>There is a problem with ChatGPT’s response, I want the image to run
disconnected. I didn’t ask for that but I would have liked ChatGPT to
catch the context. I add the <code class="language-plaintext highlighter-rouge">-d</code> option.</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c">#!/bin/sh</span>
<span class="nb">set</span> <span class="nt">-ex</span>
docker run <span class="nt">-d</span> <span class="nt">-p</span> 5000:5000 manager-blind-spot-application-server
</code></pre></div></div>

<p>The next step is to push the image to a repository. It will be a
little expensive once I get past a single image but for now I’ll use
Digital Ocean.</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>docker login registry.digitalocean.com
docker tag manager-blind-spot-application-server:latest registry.digitalocean.com/manager-blind-spot/application-server:latest
docker push registry.digitalocean.com/manager-blind-spot/application-server:latest
</code></pre></div></div>

<p>And then I need to change how I create the image. I need to login to
my container repository, pull the image, and launch it. The new script
looks like this.</p>

<div class="language-python highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="kn">import</span> <span class="n">digitalocean</span>
<span class="kn">import</span> <span class="n">os</span>
<span class="kn">from</span> <span class="n">time</span> <span class="kn">import</span> <span class="n">sleep</span>

<span class="c1"># Set up your Digital Ocean API token
</span><span class="n">api_token</span> <span class="o">=</span> <span class="n">os</span><span class="p">.</span><span class="n">environ</span><span class="p">.</span><span class="nf">get</span><span class="p">(</span><span class="sh">'</span><span class="s">DIGITALOCEAN_APIKEY</span><span class="sh">'</span><span class="p">)</span>

<span class="c1"># Create a Droplet instance
</span><span class="n">manager</span> <span class="o">=</span> <span class="n">digitalocean</span><span class="p">.</span><span class="nc">Manager</span><span class="p">(</span><span class="n">token</span><span class="o">=</span><span class="n">api_token</span><span class="p">)</span>

<span class="c1"># Get the SSH keys
</span><span class="n">sshKeys</span> <span class="o">=</span> <span class="n">manager</span><span class="p">.</span><span class="nf">get_all_sshkeys</span><span class="p">()</span>

<span class="c1"># Define the Cloud-Init script
</span><span class="n">cloudConfig</span> <span class="o">=</span> <span class="sa">f</span><span class="sh">'''</span><span class="s">
#cloud-config

packages:
  - docker.io

# create the docker group
groups:
  - docker

# Add default auto created user to docker group
system_info:
  default_user:
    groups: [docker]

runcmd:
  - </span><span class="sh">'</span><span class="s">docker login --username </span><span class="sh">"</span><span class="si">{</span><span class="n">api_token</span><span class="si">}</span><span class="sh">"</span><span class="s"> --password </span><span class="sh">"</span><span class="si">{</span><span class="n">api_token</span><span class="si">}</span><span class="sh">"</span><span class="s"> registry.digitalocean.com</span><span class="sh">'</span><span class="s">
  - </span><span class="sh">'</span><span class="s">docker pull registry.digitalocean.com/manager-blind-spot/application-server:latest</span><span class="sh">'</span><span class="s">
  - </span><span class="sh">'</span><span class="s">docker run -d -p 80:5000 registry.digitalocean.com/manager-blind-spot/application-server:latest</span><span class="sh">'</span><span class="s">
</span><span class="sh">'''</span>

<span class="c1"># Define the parameters for creating the droplet
</span><span class="n">droplet_params</span> <span class="o">=</span> <span class="p">{</span>
    <span class="sh">'</span><span class="s">name</span><span class="sh">'</span><span class="p">:</span> <span class="sh">'</span><span class="s">ubuntu-s-1vcpu-1gb-tor1-01</span><span class="sh">'</span><span class="p">,</span>  <span class="c1"># Set your desired droplet name
</span>    <span class="sh">'</span><span class="s">region</span><span class="sh">'</span><span class="p">:</span> <span class="sh">'</span><span class="s">tor1</span><span class="sh">'</span><span class="p">,</span>  <span class="c1"># Set your desired region
</span>    <span class="sh">'</span><span class="s">size</span><span class="sh">'</span><span class="p">:</span> <span class="sh">'</span><span class="s">s-1vcpu-1gb</span><span class="sh">'</span><span class="p">,</span>  <span class="c1"># Set the droplet size
</span>    <span class="sh">'</span><span class="s">image</span><span class="sh">'</span><span class="p">:</span> <span class="sh">'</span><span class="s">ubuntu-22-04-x64</span><span class="sh">'</span><span class="p">,</span>  <span class="c1"># Set the droplet image
</span>    <span class="sh">'</span><span class="s">ssh_keys</span><span class="sh">'</span><span class="p">:</span> <span class="n">sshKeys</span><span class="p">,</span>  <span class="c1"># Set the droplet SSH keys
</span>    <span class="sh">'</span><span class="s">backups</span><span class="sh">'</span><span class="p">:</span> <span class="bp">False</span><span class="p">,</span>
    <span class="sh">'</span><span class="s">ipv6</span><span class="sh">'</span><span class="p">:</span> <span class="bp">False</span><span class="p">,</span>
    <span class="sh">'</span><span class="s">user_data</span><span class="sh">'</span><span class="p">:</span> <span class="bp">None</span><span class="p">,</span>
    <span class="sh">'</span><span class="s">private_networking</span><span class="sh">'</span><span class="p">:</span> <span class="bp">None</span><span class="p">,</span>
    <span class="sh">'</span><span class="s">volumes</span><span class="sh">'</span><span class="p">:</span> <span class="bp">None</span><span class="p">,</span>
    <span class="sh">'</span><span class="s">user_data</span><span class="sh">'</span><span class="p">:</span> <span class="n">cloudConfig</span>
<span class="p">}</span>

<span class="c1"># Create the droplet
</span><span class="n">droplet</span> <span class="o">=</span> <span class="n">digitalocean</span><span class="p">.</span><span class="nc">Droplet</span><span class="p">(</span><span class="n">token</span><span class="o">=</span><span class="n">api_token</span><span class="p">,</span> <span class="o">**</span><span class="n">droplet_params</span><span class="p">)</span>
<span class="n">droplet</span><span class="p">.</span><span class="nf">create</span><span class="p">()</span>

<span class="nf">print</span><span class="p">(</span><span class="sa">f</span><span class="sh">"</span><span class="s">Waiting for droplet to become active...</span><span class="sh">"</span><span class="p">)</span>
<span class="k">while</span> <span class="bp">True</span><span class="p">:</span>
    <span class="n">droplet</span><span class="p">.</span><span class="nf">load</span><span class="p">()</span>
    <span class="nf">print</span><span class="p">(</span><span class="n">droplet</span><span class="p">.</span><span class="n">status</span><span class="p">)</span>
    <span class="k">if</span> <span class="n">droplet</span><span class="p">.</span><span class="n">status</span> <span class="o">==</span> <span class="sh">"</span><span class="s">active</span><span class="sh">"</span><span class="p">:</span>
        <span class="k">break</span>
    <span class="nf">sleep</span><span class="p">(</span><span class="mi">10</span><span class="p">)</span>

<span class="nf">print</span><span class="p">(</span><span class="sa">f</span><span class="sh">"</span><span class="s">Created droplet with ID: </span><span class="si">{</span><span class="n">droplet</span><span class="p">.</span><span class="nb">id</span><span class="si">}</span><span class="sh">"</span><span class="p">)</span>
<span class="nf">print</span><span class="p">(</span><span class="sa">f</span><span class="sh">"</span><span class="s">Droplet IP: </span><span class="si">{</span><span class="n">droplet</span><span class="p">.</span><span class="n">networks</span><span class="p">[</span><span class="sh">'</span><span class="s">v4</span><span class="sh">'</span><span class="p">][</span><span class="mi">0</span><span class="p">][</span><span class="sh">'</span><span class="s">ip_address</span><span class="sh">'</span><span class="p">]</span><span class="si">}</span><span class="sh">"</span><span class="p">)</span>
</code></pre></div></div>

<p>Launching the instance is the same, and the result is that I can now
check the health of the service.</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code> curl 137.184.172.82/health
{"message":"Application is running smoothly.","status":"healthy"}
</code></pre></div></div>]]></content><author><name>Dean Giberson</name><email>dean@deangiberson.com</email></author><category term="chatgpt-experiment" /><summary type="html"><![CDATA[Up until now we have been putting together infrastructure to run the application on. We will now get to building the root of the application. I start by breaking out the task for creating a docker container into it’s own task. To do that I ask the following of ChatGPT, I would like to work on Master Plan Step 1 - "Create a Docker container for running your application." I will be building the application from a laptop. Break this task down into simple steps that I can follow. Refer to this task list as the "Create Docker Container Plan".]]></summary></entry></feed>