Skip to content

Commit

Permalink
refactor: migrate to bun
Browse files Browse the repository at this point in the history
  • Loading branch information
divyam234 committed Oct 13, 2024
1 parent 1a95849 commit 25fbe1e
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 9,346 deletions.
15 changes: 6 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
FROM node:alpine AS build
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
RUN corepack enable
FROM oven/bun AS build
COPY . /app
WORKDIR /app
RUN pnpm install --frozen-lockfile
RUN pnpm run build:client
RUN pnpm run build:server
RUN bun install
RUN bun run build:client
RUN bun run build:server

FROM ghcr.io/tgdrive/node
FROM oven/bun:distroless
WORKDIR /app
COPY --from=build /app/build ./build
ENV NODE_ENV=production
EXPOSE 8080
ENTRYPOINT [ "node", "build/server/index.mjs" ]
ENTRYPOINT [ "bun", "run", "build/server/index.js" ]
Binary file added bun.lockb
Binary file not shown.
11 changes: 5 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@
"version": "0.0.2",
"private": true,
"scripts": {
"vite:client": "vite",
"vite:server": "node build/server/index.mjs",
"vite": "vite",
"dev:server": "bun --watch server/index.ts",
"server": "bun run build/server/index.js",
"build:client": "vite build",
"build:server": "vite build -c vite.server.config.mts",
"build:server": "bun build --target=bun server/index.ts --outdir ./build/server",
"update": "pnpm up --latest"
},
"dependencies": {
Expand Down Expand Up @@ -47,18 +48,16 @@
},
"devDependencies": {
"@biomejs/biome": "1.9.3",
"@cloudflare/workers-types": "^4.20241011.0",
"@hono/node-server": "^1.13.2",
"@iconify/json": "^2.2.259",
"@svgr/core": "^8.1.0",
"@svgr/plugin-jsx": "^8.1.0",
"@tailwindcss/aspect-ratio": "^0.4.2",
"@tanstack/react-query-devtools": "5.59.13",
"@types/bun": "^1.1.11",
"@types/react": "^18.3.11",
"@types/react-dom": "^18.3.1",
"@vitejs/plugin-react": "^4.3.2",
"autoprefixer": "^10.4.20",
"dotenv": "^16.4.5",
"postcss": "^8.4.47",
"tailwind-merge": "^2.5.3",
"tailwindcss": "^3.4.13",
Expand Down
Loading

0 comments on commit 25fbe1e

Please sign in to comment.