initial commit
This commit is contained in:
26
Dockerfile
Normal file
26
Dockerfile
Normal file
@@ -0,0 +1,26 @@
|
||||
# 1단계: 빌드 (Node.js)
|
||||
FROM node:20-alpine AS build
|
||||
WORKDIR /app
|
||||
COPY package*.json ./
|
||||
RUN rm -f package-lock.json && npm install
|
||||
COPY . .
|
||||
RUN npm run build
|
||||
|
||||
# 2단계: 실행 (Nginx)
|
||||
# 2단계: 실행 (Node.js)
|
||||
FROM node:20-alpine
|
||||
WORKDIR /app
|
||||
|
||||
# 프로덕션 의존성만 설치
|
||||
COPY package*.json ./
|
||||
RUN npm install --omit=dev
|
||||
|
||||
# 서버 파일 및 빌드 결과물 복사
|
||||
COPY server.js ./
|
||||
COPY --from=build /app/dist ./dist
|
||||
|
||||
# 환경변수 포트 노출
|
||||
EXPOSE 80
|
||||
|
||||
# 서버 실행
|
||||
CMD ["node", "server.js"]
|
||||
Reference in New Issue
Block a user