From 9f171e5c7509830f0435404ea212744751a99abc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian=20T=C3=B6lle?= Date: Sun, 2 Apr 2023 21:59:41 +0200 Subject: [PATCH] build: invert dockerignore With the normal dockerignore it regularly happens that unwanted files end up in the image. By denying everything and then allowing the desired files we have a more verbose dockerignore, but the context is as small as possible. --- .dockerignore | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/.dockerignore b/.dockerignore index 3e72e30..396acda 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,7 +1,21 @@ -node_modules/ -dist/ +# Ignore all and then selectivly allow +**/* -frontend/node_modules/ -frontend/src/tailwind/tailwind.generated.css +# api +!package.json +!package-lock.json +!nest-cli.json +!tsconfig.build.json +!tsconfig.json -charts/ +!src/**/* + +# frontend +!frontend/.env.production +!frontend/package.json +!frontend/package-lock.json +!frontend/postcss.config.js +!frontend/tailwind.config.js +!frontend/tsconfig.json +!frontend/src/**/* +!frontend/public/**/*