FROM alpine:3.13
ENV DOCKER=true
EXPOSE 8360
# 选用国内镜像源以提高下载速度
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.tencent.com/g' /etc/apk/repositories \
&& apk add --update --no-cache nodejs npm
# 指定工作目录
WORKDIR /myapp
# 拷贝包管理文件
COPY package.json .
# 拷贝包管理lock文件
COPY package-lock.json .
# npm 源,选用国内镜像源以提高下载速度
RUN npm config set registry https://mirrors.cloud.tencent.com/npm/
# npm 安装依赖
RUN npm install
COPY . .
CMD [ "node", "/myapp/production.js" ]