From e9b9fa2ffef7d9bfbe99061455cc1788083a2b15 Mon Sep 17 00:00:00 2001 From: blam Date: Wed, 27 Jan 2021 16:38:27 +0100 Subject: [PATCH 1/2] chore: added a note about .dockerignore --- docs/getting-started/deployment-other.md | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/docs/getting-started/deployment-other.md b/docs/getting-started/deployment-other.md index 6436bdb195..92c5622593 100644 --- a/docs/getting-started/deployment-other.md +++ b/docs/getting-started/deployment-other.md @@ -62,8 +62,26 @@ COPY app-config.yaml app-config.production.yaml ./ CMD ["node", "packages/backend", "--config", "app-config.yaml", "--config", "app-config.production.yaml"] ``` -You can add the Dockerfile to the root of your project, and run the following to -build the container under a specified tag. +Before building you should also include a `.dockerignore`. This will greatly +improve the context bootup of Docker as we are no longer sending all of the +`node_modules` into the context. It also helps us avoid some limitations and +errors that may occur when trying to share the `node_modules` folder to inside +the build. + +You can add the following contents to the root of your repository at +`.dockerignore` and it might look something like the following: + +```dockerignore +.git +node_modules +packages/*/node_modules +plugins/*/node_modules +plugins/*/dist +``` + +Once you have added both the `Dockerfile` and `.dockerignore` to the root of +your project, and run the following to build the container under a specified +tag. ```sh $ docker build -t example-deployment . From 1f675381a9143ec63037270f2821ea5c51dedb64 Mon Sep 17 00:00:00 2001 From: blam Date: Wed, 27 Jan 2021 21:59:44 +0100 Subject: [PATCH 2/2] chore: fixing vale stuff --- docs/getting-started/deployment-other.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/getting-started/deployment-other.md b/docs/getting-started/deployment-other.md index 92c5622593..418a6b3dd3 100644 --- a/docs/getting-started/deployment-other.md +++ b/docs/getting-started/deployment-other.md @@ -63,8 +63,8 @@ CMD ["node", "packages/backend", "--config", "app-config.yaml", "--config", "app ``` Before building you should also include a `.dockerignore`. This will greatly -improve the context bootup of Docker as we are no longer sending all of the -`node_modules` into the context. It also helps us avoid some limitations and +improve the context boot up time of Docker as we are no longer sending all of +the `node_modules` into the context. It also helps us avoid some limitations and errors that may occur when trying to share the `node_modules` folder to inside the build.