Skip to content

Commit

Permalink
Fix lifecycle hooks in Dockerfile (#11)
Browse files Browse the repository at this point in the history
Ignore lifecycle hooks when installing dependencies in the Dockerfile. This prevents husky from
running hooks.
  • Loading branch information
kenowi-dev authored Sep 12, 2023
1 parent 105214b commit 79c78b9
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 21 deletions.
38 changes: 19 additions & 19 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
FROM oven/bun:latest AS build

WORKDIR /app
COPY package.json bun.lockb ./
RUN bun install --frozen-lockfile

COPY . .
RUN bun run build


FROM oven/bun:latest
WORKDIR /app

COPY --from=build /app/build /app/package.json /app/bun.lockb ./
RUN bun install --production
# Required by svelte-adapter-bun (for whatever reason)
RUN bun install devalue cookie set-cookie-parser

ENTRYPOINT ["bun", "index.js"]
FROM oven/bun:latest AS build

WORKDIR /app
COPY package.json bun.lockb ./
RUN bun install --frozen-lockfile --ignore-scripts

COPY . .
RUN bun run build


FROM oven/bun:latest
WORKDIR /app

COPY --from=build /app/build /app/package.json /app/bun.lockb ./
RUN bun install --production
# Required by svelte-adapter-bun (for whatever reason)
RUN bun install devalue cookie set-cookie-parser

ENTRYPOINT ["bun", "index.js"]
Binary file modified bun.lockb
Binary file not shown.
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./jsconfig.json --watch",
"lint": "prettier --plugin prettier-plugin-svelte --plugin prettier-plugin-tailwindcss --check . && eslint .",
"format": "prettier --plugin prettier-plugin-svelte --plugin prettier-plugin-tailwindcss --write .",
"prepare": "if-not-ci husky install",
"prepare": "husky install",
"commit": "cz"
},
"devDependencies": {
Expand All @@ -31,7 +31,6 @@
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-svelte": "^2.33.0",
"husky": "^8.0.0",
"if-ci": "^3.0.0",
"inquirer": "8",
"postcss": "^8.4.29",
"postcss-load-config": "^4.0.1",
Expand Down

0 comments on commit 79c78b9

Please sign in to comment.