Commit a46009a5 authored by huanglu's avatar huanglu

feat: Dockerfile 文件

parent 0cfce6d0
# node镜像
FROM node:12-alpine
# 设置时区
RUN apk --update add tzdata \
&& cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \
&& echo "Asia/Shanghai" > /etc/timezone \
&& apk del tzdata
# 这个是容器中的文件目录
RUN mkdir -p /usr/app
# 设置工作目录
WORKDIR /usr/app
COPY package.json /usr/app/package.json
# 安装npm依赖(使用淘宝的镜像源)
# 如果使用的境外服务器,无需使用淘宝的镜像源,即改为`RUN npm i`。
RUN npm i --registry=https://registry.npm.taobao.org
# 拷贝所有源代码到工作目
COPY . /usr/app
# 暴露容器端口
EXPOSE 3008
CMD npm run start
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment