From e854091fda883477134030c7f916130154d33851 Mon Sep 17 00:00:00 2001 From: waruneeauy Date: Tue, 16 Sep 2025 16:52:45 +0700 Subject: [PATCH] fix build --- .dockerignore | 11 +++++++++++ Dockerfile | 13 +++++++++---- 2 files changed, 20 insertions(+), 4 deletions(-) create mode 100644 .dockerignore diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..50dacd1 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,11 @@ +node_modules +.git +.gitignore +README.md +.env +.nyc_output +coverage +.nyc_output +*.md +test-run +.vscode diff --git a/Dockerfile b/Dockerfile index 520ab99..c4f32b8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -31,12 +31,17 @@ RUN npx puppeteer install chrome --install-deps RUN fc-cache -f && rm -rf /var/cache/* && apt -y autoremove && rm -rf /var/lib/apt/lists/* && apt-get clean RUN mkdir /app WORKDIR /app -COPY templates templates COPY package.json . -ENV NODE_ENV=production +COPY tsconfig.json . +COPY libs libs +COPY app.ts . +COPY yaqrcode.d.ts . +COPY templates templates +ENV NODE_ENV=development RUN npm install +RUN npm run build +ENV NODE_ENV=production +RUN npm prune --production - -COPY dist2 . EXPOSE 80 CMD ["node","app.js"]