line-bot-ts/Dockerfile

29 lines
680 B
Docker
Raw Normal View History

2023-01-17 03:38:17 +00:00
# sudo docker build -t linebotts .
2024-02-26 03:46:31 +00:00
# sudo docker run -v /volume1/homes/JianMiau/www/certificate:/certificate --name=linebotts --restart always --net=host linebotts
# docker ps
# sudo docker exec -it f39bfa9c0819 /bin/bash
2023-01-17 03:38:17 +00:00
# 選擇node
FROM node:19.4.0
# 指定NODE_ENV為production
ENV NODE_ENV=production
# 指定預設/工作資料夾
WORKDIR /app
2024-02-26 03:46:31 +00:00
VOLUME ["/certificate"]
2023-01-17 03:38:17 +00:00
# 只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" ]