Skip to content

Commit

Permalink
refactor(docker): optimize Dockerfile and update dependencies
Browse files Browse the repository at this point in the history
Signed-off-by: Robert Goniszewski <[email protected]>
  • Loading branch information
goniszewski committed Aug 20, 2024
1 parent a956f16 commit db8c8f1
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 10 deletions.
9 changes: 4 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
FROM node:20-slim AS base
RUN corepack enable
FROM oven/bun AS base
RUN apt-get update && apt-get install -y python3 python3-pip wget build-essential && rm -rf /var/lib/apt/lists/*
RUN npm i -g bun@latest
RUN bun i -g svelte-kit@latest
WORKDIR /usr/src/app

FROM base AS install
WORKDIR /temp/dev
COPY package.json bun.lockb ./
RUN bun install --frozen-lockfile || (echo "Bun install failed" && cat ~/.bun/install.log && exit 1)
RUN bun install --frozen-lockfile

WORKDIR /temp/prod
COPY package.json bun.lockb ./
RUN bun install --frozen-lockfile --production || (echo "Bun install failed" && cat ~/.bun/install.log && exit 1)
RUN bun install --frozen-lockfile --production

FROM base AS prerelease
COPY --from=install /temp/dev/node_modules node_modules
Expand Down
Binary file modified bun.lockb
Binary file not shown.
6 changes: 1 addition & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,9 @@
"core-js-pure",
"esbuild",
"install-from-cache",
"node-gyp",
"postinstall",
"prebuild-install",
"re2",
"svelte-preprocess",
"tree-sitter",
"tree-sitter-yaml"
"svelte-preprocess"
],
"scripts": {
"dev": "vite dev",
Expand Down

0 comments on commit db8c8f1

Please sign in to comment.