You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+15-5Lines changed: 15 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -124,6 +124,8 @@ Run this command to start an interactive shell:
124
124
docker compose run -it --rm --entrypoint /bin/sh -v ./nodejs:/var/task lambda
125
125
```
126
126
127
+
<!-- --user "$(id -u):$(id -g)" -->
128
+
127
129
> [!WARNING]
128
130
> Due to AWS not creating multi-platform images we need to start an interactive shell rather than passing in commands.
129
131
> For example, if we were to run the following command:
@@ -258,6 +260,12 @@ RUN npm ci && npm run build
258
260
CMD [ "build/index.handler" ]
259
261
```
260
262
263
+
Run the following command:
264
+
265
+
```shell
266
+
docker compose build
267
+
```
268
+
261
269
> [!NOTE]
262
270
> 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.
263
271
>
@@ -271,7 +279,7 @@ CMD [ "build/index.handler" ]
271
279
<!-- -->
272
280
273
281
> [!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:
275
283
>
276
284
>```shell
277
285
> $ docker images
@@ -309,23 +317,25 @@ lambda:
309
317
310
318
> [!TIP]
311
319
> 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:
313
321
>
314
322
> ```shell
315
323
> $ docker ps
316
324
> 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
318
326
>```
319
327
>
320
328
> If you ran `docker ps` once the container was able to pass the healthcheck you would hopefully see the following:
321
329
>
322
330
>```shell
323
331
> $ docker ps
324
332
> 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
326
334
>```
327
335
>
328
336
> _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.**
329
339
330
340
### Add cURL service
331
341
@@ -346,7 +356,7 @@ services:
346
356
```
347
357
348
358
> [!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.
0 commit comments