25 lines
510 B
Docker
25 lines
510 B
Docker
|
# sudo docker build -t linebotts .
|
||
|
# sudo docker exec -it 2e8e3995aa52 /bin/bash
|
||
|
|
||
|
# 選擇node
|
||
|
FROM node:19.4.0
|
||
|
|
||
|
# 指定NODE_ENV為production
|
||
|
ENV NODE_ENV=production
|
||
|
|
||
|
# 指定預設/工作資料夾
|
||
|
WORKDIR /app
|
||
|
|
||
|
# 只copy package.json檔案
|
||
|
COPY ["package.json", "./"]
|
||
|
|
||
|
# 安裝dependencies
|
||
|
# If you are building your code for production
|
||
|
# RUN npm ci --only=production
|
||
|
RUN npm install
|
||
|
|
||
|
# copy其餘目錄及檔案
|
||
|
COPY . .
|
||
|
|
||
|
# 指定啟動container後執行命令
|
||
|
CMD [ "npm", "start" ]
|