Skip to content

Commit

Permalink
FEAT :: dockerfile 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
soyeonkim0227 committed May 10, 2024
1 parent 21041ff commit 25cf6a0
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules
dist
30 changes: 30 additions & 0 deletions dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# dependency install
FROM node:18 AS install
WORKDIR /app
COPY package*.json ./

RUN npm install

COPY . .

ARG NODE_ENV production
ENV NODE_ENV NODE_ENV

RUN npm run build

CMD ["node", "dist/main.js"]



# # image create
# FROM node:18-alpine AS build
# WORKDIR /app

# COPY --chown=node:node --from=install /app/node_modules ./node_modules
# COPY --chown=node:node . .

# RUN npm run build

# ENV NODE_ENV production

# RUN npm ci --only=production && npm cache clean

0 comments on commit 25cf6a0

Please sign in to comment.