replace npm w/ bun
This commit is contained in:
parent
1d42a9a623
commit
007263977b
3 changed files with 27 additions and 23 deletions
|
|
@ -1,10 +1,14 @@
|
|||
FROM node:20-alpine AS builder
|
||||
# Use Bun base image for builder
|
||||
FROM oven/bun:1-alpine AS builder
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# Copy package files
|
||||
COPY package*.json ./
|
||||
RUN npm ci
|
||||
COPY bun.lockb* ./
|
||||
|
||||
# Install dependencies with Bun
|
||||
RUN bun install --frozen-lockfile
|
||||
|
||||
# Copy source files
|
||||
COPY . .
|
||||
|
|
@ -14,14 +18,11 @@ ENV VITE_API_URL=http://localhost/api
|
|||
ENV VITE_WS_URL=ws://localhost/ws
|
||||
ENV VITE_STREAM_PORT=8088
|
||||
|
||||
# Generate .svelte-kit directory
|
||||
RUN npx svelte-kit sync
|
||||
|
||||
# Build the application
|
||||
RUN npm run build
|
||||
RUN bun run build
|
||||
|
||||
# Production stage
|
||||
FROM node:20-alpine
|
||||
# Production stage - can still use Bun
|
||||
FROM oven/bun:1-alpine
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
|
|
@ -30,7 +31,7 @@ COPY --from=builder /app/build ./build
|
|||
COPY --from=builder /app/package*.json ./
|
||||
|
||||
# Install production dependencies only
|
||||
RUN npm ci --omit=dev
|
||||
RUN bun install --production
|
||||
|
||||
# Expose port
|
||||
EXPOSE 3000
|
||||
|
|
@ -38,4 +39,5 @@ EXPOSE 3000
|
|||
# Set environment to production
|
||||
ENV NODE_ENV=production
|
||||
|
||||
CMD ["node", "build"]
|
||||
# Run with Bun
|
||||
CMD ["bun", "run", "build/index.js"]
|
||||
|
|
@ -24,7 +24,7 @@
|
|||
"@fortawesome/fontawesome-free": "^6.7.2",
|
||||
"hls.js": "^1.6.7",
|
||||
"mdb-ui-kit": "^9.1.0",
|
||||
"openpgp": "^5.11.0",
|
||||
"openpgp": "^6.0.0-alpha.0",
|
||||
"ovenplayer": "^0.10.43"
|
||||
},
|
||||
"type": "module"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue