From b7cb5c8822495be623a99b7be1abc5fea3b4efe0 Mon Sep 17 00:00:00 2001 From: Basti Ortiz <39114273+BastiDood@users.noreply.github.com> Date: Tue, 6 Aug 2024 06:08:32 +0800 Subject: [PATCH] refactor(docker): separate build step from deploy step --- .dockerignore | 9 +++++++-- Dockerfile | 5 ++--- app/package.json | 4 +--- email/package.json | 4 +--- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.dockerignore b/.dockerignore index 373a178..7bc8e20 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,3 +1,4 @@ +.dockerignore .env .git .github @@ -8,10 +9,14 @@ .stylelintrc.json .svelte-kit +Dockerfile +LICENSE +README.md +eslint.config.js +fly.toml + build data dist node_modules postgres - -eslint.config.json diff --git a/Dockerfile b/Dockerfile index 06391b3..7462212 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,9 +8,8 @@ COPY pnpm-lock.yaml ./ RUN pnpm fetch COPY . ./ RUN pnpm install --recursive --offline -RUN pnpm --parallel --recursive build -RUN pnpm --filter=drap-email --prod deploy /prod/email -RUN pnpm --filter=drap-app --prod deploy /prod/app +RUN pnpm --filter=drap-email --prod deploy /prod/email && pnpm --filter=drap-app --prod deploy /prod/app +RUN pnpm --parallel --recursive build && mv email/dist/ /prod/email && mv app/build/ /prod/app FROM node:22.5.1-alpine3.20 AS deploy COPY --from=build /prod/ /drap/ diff --git a/app/package.json b/app/package.json index bc3f0ca..474f8a0 100644 --- a/app/package.json +++ b/app/package.json @@ -3,9 +3,7 @@ "version": "0.0.0", "type": "module", "private": true, - "files": [ - "./build/*" - ], + "files": [], "scripts": { "dev": "vite", "build": "vite build", diff --git a/email/package.json b/email/package.json index a0b8420..0040981 100644 --- a/email/package.json +++ b/email/package.json @@ -3,9 +3,7 @@ "version": "0.0.0", "type": "module", "private": true, - "files": [ - "./dist/*" - ], + "files": [], "scripts": { "build": "tsup", "start": "node --enable-source-maps --env-file=.env --import=@swc-node/register/esm-register src/main.ts"