a / Dockerfile
blueddd's picture
Create Dockerfile
4db20f9 verified
raw
history blame contribute delete
406 Bytes
# 使用官方 Node.js 镜像
FROM node:16
#时区设置为中国
ENV TZ=Asia/Shanghai
# 设置工作目录
WORKDIR /app
# 将 package.json 和 package-lock.json 复制到容器中
COPY package*.json ./
# 安装依赖
RUN npm install
# 将项目文件复制到容器
COPY . .
RUN chmod -R 777 /app
# 暴露端口(默认的 Node.js 端口是 3000)
EXPOSE 3000
# 启动应用
CMD ["npm", "start"]