npm only
This commit is contained in:
+13
-19
@@ -1,31 +1,25 @@
|
||||
FROM oven/bun:1 AS build-stage
|
||||
# --- Base build + production image ---
|
||||
FROM node:20-slim AS app
|
||||
WORKDIR /app
|
||||
|
||||
# Install sharp dependencies for Linux
|
||||
# Install dependencies needed to build sharp
|
||||
RUN apt-get update && apt-get install -y \
|
||||
python3 \
|
||||
make \
|
||||
g++ \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
COPY package.json bun.lockb* ./
|
||||
RUN bun install --frozen-lockfile
|
||||
# Copy package files and install dependencies
|
||||
COPY package*.json ./
|
||||
RUN npm ci --omit=dev
|
||||
|
||||
# Copy project files and build
|
||||
COPY . .
|
||||
RUN bun run build
|
||||
|
||||
FROM oven/bun:1 AS production-stage
|
||||
WORKDIR /app
|
||||
|
||||
# Install sharp dependencies in production stage as well
|
||||
RUN apt-get update && apt-get install -y \
|
||||
python3 \
|
||||
make \
|
||||
g++ \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
COPY --from=build-stage /app /app
|
||||
RUN npm run build
|
||||
|
||||
# Expose port and set env vars
|
||||
EXPOSE 3000
|
||||
ENV NODE_ENV=production
|
||||
CMD ["bun", "run", "start"]
|
||||
|
||||
# Start the app
|
||||
CMD ["npm", "run", "start"]
|
||||
Reference in New Issue
Block a user