first commit
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
# Build stage
|
||||
FROM node:20-alpine AS builder
|
||||
|
||||
WORKDIR /usr/src/app
|
||||
|
||||
COPY package*.json ./
|
||||
RUN npm install
|
||||
|
||||
COPY . .
|
||||
|
||||
# Prisma client 생성 및 TypeScript 빌드
|
||||
RUN npx prisma generate
|
||||
RUN npm run build
|
||||
|
||||
# Production stage
|
||||
FROM node:20-alpine
|
||||
|
||||
WORKDIR /usr/src/app
|
||||
|
||||
COPY package*.json ./
|
||||
RUN npm install --only=production
|
||||
|
||||
COPY --from=builder /usr/src/app/dist ./dist
|
||||
COPY --from=builder /usr/src/app/node_modules/.prisma ./node_modules/.prisma
|
||||
COPY --from=builder /usr/src/app/node_modules/@prisma/client ./node_modules/@prisma/client
|
||||
COPY --from=builder /usr/src/app/prisma ./prisma
|
||||
|
||||
EXPOSE 4000
|
||||
|
||||
# Prisma 마이그레이션 실행 후 백엔드 서버 실행
|
||||
CMD ["sh", "-c", "npx prisma migrate deploy && node dist/index.js"]
|
||||
Reference in New Issue
Block a user