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
|
FROM node:20-alpine AS base
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
# Install dependencies
|
# Install Bun
|
||||||
FROM base AS install
|
|
||||||
RUN npm install -g bun
|
RUN npm install -g bun
|
||||||
COPY package.json ./
|
|
||||||
|
# Install dependencies
|
||||||
|
COPY package.json bun.lockb* ./
|
||||||
RUN bun install
|
RUN bun install
|
||||||
|
|
||||||
# Build
|
# Copy source code
|
||||||
FROM base AS build
|
|
||||||
COPY --from=install /app/node_modules ./node_modules
|
|
||||||
COPY . .
|
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 NODE_ENV=production
|
||||||
ENV PORT=3001
|
ENV PORT=3001
|
||||||
|
|
||||||
EXPOSE 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