From e20c1bf878b4788a57b5c95ecd71dab74857c43a Mon Sep 17 00:00:00 2001 From: Gary Rutland Date: Thu, 27 Nov 2025 14:30:17 +0000 Subject: [PATCH 1/2] Final tweaks --- README.md | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 69293cd..b3fc364 100644 --- a/README.md +++ b/README.md @@ -124,6 +124,8 @@ Run this command to start an interactive shell: docker compose run -it --rm --entrypoint /bin/sh -v ./nodejs:/var/task lambda ``` + + > [!WARNING] > Due to AWS not creating multi-platform images we need to start an interactive shell rather than passing in commands. > For example, if we were to run the following command: @@ -258,6 +260,12 @@ RUN npm ci && npm run build CMD [ "build/index.handler" ] ``` +Run the following command: + +```shell +docker compose build +``` + > [!NOTE] > As we're now doing the dependency install as part of the build, when you run `docker images` you'll notice our Docker image has increased in size. > @@ -271,7 +279,7 @@ CMD [ "build/index.handler" ] > [!TIP] -> When running `docker images` you'll notice that we have got a dangling image that looks a bit like this: +> When running `docker images` you might notice that you have got a dangling image that looks a bit like this: > > ```shell > $ docker images @@ -309,12 +317,12 @@ lambda: > [!TIP] > The healthcheck allows Docker (and us) to know when a container is up and running as expected. -> If you were to run `docker ps` in a different terminal window while our containers were starting up you might see the following: +> If you were to run `docker compose up` and then run `docker ps` in a different terminal window while our containers were starting up you might see the following: > > ```shell > $ docker ps > CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES -> bf2696aeaabf solution-lambda "/lambda-entrypoint.…" 1 second ago Up Less than a second (health: starting) your-lambda-1 +> bf2696aeaabf your-lambda "/lambda-entrypoint.…" 1 second ago Up Less than a second (health: starting) your-lambda-1 > ``` > > If you ran `docker ps` once the container was able to pass the healthcheck you would hopefully see the following: @@ -322,10 +330,12 @@ lambda: > ```shell > $ docker ps > CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES -> bf2696aeaabf solution-lambda "/lambda-entrypoint.…" 36 seconds ago Up 35 seconds (healthy) your-lambda-1 +> bf2696aeaabf your-lambda "/lambda-entrypoint.…" 36 seconds ago Up 35 seconds (healthy) your-lambda-1 > ``` > > _If the container wasn't able to pass the healthcheck then you would eventually see `unhealthy` instead._ +> +> **If you did run `docker compose up` you will need press Ctrl+C on your keyboard to exit the container.** ### Add cURL service From 56bb37cb0c3bfbb6da004870b1526d7af9033c63 Mon Sep 17 00:00:00 2001 From: Gary Rutland Date: Thu, 27 Nov 2025 14:39:02 +0000 Subject: [PATCH 2/2] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b3fc364..4d16555 100644 --- a/README.md +++ b/README.md @@ -356,7 +356,7 @@ services: ``` > [!NOTE] -> As we have the healthceck in place, we can actually tell the `curl` container not to start until it gets that healthy response. +> As we have the healthcheck in place, we can actually tell the `curl` container not to start until it gets that healthy response. ### Run the stack