-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathDockerfile
34 lines (24 loc) · 1.09 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
FROM node:16.13.1
# 容器默认时区为UTC,如需使用上海时间请启用以下时区设置命令
# RUN apk add tzdata && cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && echo Asia/Shanghai > /etc/timezone
# 使用 HTTPS 协议访问容器云调用证书安装
# RUN apk add ca-certificates
# 安装依赖包,如需其他依赖包,请到alpine依赖包管理(https://pkgs.alpinelinux.org/packages?name=php8*imagick*&branch=v3.13)查找。
# 选用国内镜像源以提高下载速度
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.tencent.com/g' /etc/apk/repositories \
&& apk add --update --no-cache nodejs npm
# # 指定工作目录
WORKDIR /app
# 拷贝包管理文件
COPY . /app
# npm 源,选用国内镜像源以提高下载速度
# RUN npm config set registry https://mirrors.cloud.tencent.com/npm/
# RUN npm config set registry https://registry.npm.taobao.org/
RUN npm config set registry https://mirrors.cloud.tencent.com/npm/ \
&& npm install -g [email protected] \
&& npm install -g nest \
&& npm install \
&& npm run build
EXPOSE 80
# 执行启动命令
CMD ["node","dist/main.js"]