Skip to content

Commit 0b9ff3d

Browse files
authored
Final tweaks (#4)
* Final tweaks * Update README.md
1 parent beca1ec commit 0b9ff3d

File tree

1 file changed

+15
-5
lines changed

1 file changed

+15
-5
lines changed

README.md

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,8 @@ Run this command to start an interactive shell:
124124
docker compose run -it --rm --entrypoint /bin/sh -v ./nodejs:/var/task lambda
125125
```
126126

127+
<!-- --user "$(id -u):$(id -g)" -->
128+
127129
> [!WARNING]
128130
> Due to AWS not creating multi-platform images we need to start an interactive shell rather than passing in commands.
129131
> For example, if we were to run the following command:
@@ -258,6 +260,12 @@ RUN npm ci && npm run build
258260
CMD [ "build/index.handler" ]
259261
```
260262

263+
Run the following command:
264+
265+
```shell
266+
docker compose build
267+
```
268+
261269
> [!NOTE]
262270
> 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.
263271
>
@@ -271,7 +279,7 @@ CMD [ "build/index.handler" ]
271279
<!-- -->
272280
273281
> [!TIP]
274-
> When running `docker images` you'll notice that we have got a dangling image that looks a bit like this:
282+
> When running `docker images` you might notice that you have got a dangling image that looks a bit like this:
275283
>
276284
> ```shell
277285
> $ docker images
@@ -309,23 +317,25 @@ lambda:
309317
310318
> [!TIP]
311319
> The healthcheck allows Docker (and us) to know when a container is up and running as expected.
312-
> If you were to run `docker ps` in a different terminal window while our containers were starting up you might see the following:
320+
> 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:
313321
>
314322
> ```shell
315323
> $ docker ps
316324
> CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
317-
> bf2696aeaabf solution-lambda "/lambda-entrypoint.…" 1 second ago Up Less than a second (health: starting) your-lambda-1
325+
> bf2696aeaabf your-lambda "/lambda-entrypoint.…" 1 second ago Up Less than a second (health: starting) your-lambda-1
318326
> ```
319327
>
320328
> If you ran `docker ps` once the container was able to pass the healthcheck you would hopefully see the following:
321329
>
322330
> ```shell
323331
> $ docker ps
324332
> CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
325-
> bf2696aeaabf solution-lambda "/lambda-entrypoint.…" 36 seconds ago Up 35 seconds (healthy) your-lambda-1
333+
> bf2696aeaabf your-lambda "/lambda-entrypoint.…" 36 seconds ago Up 35 seconds (healthy) your-lambda-1
326334
> ```
327335
>
328336
> _If the container wasn't able to pass the healthcheck then you would eventually see `unhealthy` instead._
337+
>
338+
> **If you did run `docker compose up` you will need press Ctrl+C on your keyboard to exit the container.**
329339
330340
### Add cURL service
331341
@@ -346,7 +356,7 @@ services:
346356
```
347357
348358
> [!NOTE]
349-
> As we have the healthceck in place, we can actually tell the `curl` container not to start until it gets that healthy response.
359+
> As we have the healthcheck in place, we can actually tell the `curl` container not to start until it gets that healthy response.
350360
351361
### Run the stack
352362

0 commit comments

Comments
 (0)