Skip to content

Commit

Permalink
refactor(docker): separate build step from deploy step
Browse files Browse the repository at this point in the history
  • Loading branch information
BastiDood committed Aug 5, 2024
1 parent 19d4e7f commit b7cb5c8
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
9 changes: 7 additions & 2 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.dockerignore
.env
.git
.github
Expand All @@ -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
5 changes: 2 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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/
Expand Down
4 changes: 1 addition & 3 deletions app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@
"version": "0.0.0",
"type": "module",
"private": true,
"files": [
"./build/*"
],
"files": [],
"scripts": {
"dev": "vite",
"build": "vite build",
Expand Down
4 changes: 1 addition & 3 deletions email/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit b7cb5c8

Please sign in to comment.