Fix backend Dockerfile - remove unnecessary build step
The backend is designed to run TypeScript directly with Bun, not to build. Updated Dockerfile to skip build step and run src/index.ts directly.
This commit is contained in:
@@ -1,28 +1,20 @@
|
||||
FROM node:20-alpine AS base
|
||||
WORKDIR /app
|
||||
|
||||
# Install dependencies
|
||||
FROM base AS install
|
||||
# Install Bun
|
||||
RUN npm install -g bun
|
||||
COPY package.json ./
|
||||
|
||||
# Install dependencies
|
||||
COPY package.json bun.lockb* ./
|
||||
RUN bun install
|
||||
|
||||
# Build
|
||||
FROM base AS build
|
||||
COPY --from=install /app/node_modules ./node_modules
|
||||
# Copy source code
|
||||
COPY . .
|
||||
RUN bun build
|
||||
|
||||
# Production
|
||||
FROM base AS release
|
||||
RUN npm install -g bun
|
||||
COPY --from=install /app/node_modules ./node_modules
|
||||
COPY --from=build /app/dist ./dist
|
||||
COPY package.json .
|
||||
|
||||
ENV NODE_ENV=production
|
||||
ENV PORT=3001
|
||||
|
||||
EXPOSE 3001
|
||||
|
||||
CMD ["bun", "run", "start"]
|
||||
# Run directly from TypeScript source (Bun can execute TypeScript directly)
|
||||
CMD ["bun", "run", "src/index.ts"]
|
||||
|
||||
Reference in New Issue
Block a user