From 3bdb3031018e1237490e5f3c4ae7d2efdc391377 Mon Sep 17 00:00:00 2001 From: morteza-mortezai Date: Mon, 1 Jun 2026 16:37:04 +0330 Subject: [PATCH] update: docker file to include keys in image --- .dockerignore | 67 +++++++++++++++++++++++++++++++++++++++++++++++++++ Dockerfile | 3 ++- 2 files changed, 69 insertions(+), 1 deletion(-) create mode 100644 .dockerignore diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..19abbb5 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,67 @@ +# Dependencies and build output (reinstalled/rebuilt in the image) +node_modules +dist +build + +# Git and CI +.git +.github + +# Environment and secrets (inject at runtime, not bake into the image) +.env +.env.* +!.env.example + +# Tests and coverage +test +coverage +.nyc_output +*.spec.ts + +# Logs and runtime artifacts +logs +*.log +npm-debug.log* +pnpm-debug.log* +yarn-debug.log* +yarn-error.log* +lerna-debug.log* +.pnpm-debug.log* + +# IDE and editor files +.idea +.vscode +.project +.classpath +.c9 +*.launch +.settings +*.sublime-workspace + +# OS files +.DS_Store +Thumbs.db + +# Local tooling not needed for production build +.husky +eslint.config.mjs +commitlint.config.ts +.prettierrc +.prettierignore +.editorconfig + +# Docs and local dev config +README.md +**/*.md +docker-compose.yaml +Dockerfile + +# Database migrations/seeders (not required for nest build) +database + +# Misc local directories +IPGSW1Sale +.temp +.tmp +.cache +.parcel-cache diff --git a/Dockerfile b/Dockerfile index 6abe41d..6fbd9e3 100755 --- a/Dockerfile +++ b/Dockerfile @@ -34,9 +34,10 @@ RUN addgroup -S appgroup && adduser -S appuser -G appgroup WORKDIR /app -# Copy only production node_modules and build output +# Copy only production node_modules, build output, and JWT keys COPY --from=prod-deps --chown=appuser:appgroup /temp-deps/node_modules ./node_modules COPY --from=builder --chown=appuser:appgroup /build/dist ./dist +COPY --from=builder --chown=appuser:appgroup /build/keys ./keys COPY --chown=appuser:appgroup package.json ./ RUN chown -R appuser:appgroup /app