Skip to content

Commit d78e081

Browse files
committed
fix: 修复Docker构建OOM异常,使用增加OOM限制的node:20.17.0-alpine基础镜像
1 parent 7b7d698 commit d78e081

File tree

2 files changed

+5
-10
lines changed

2 files changed

+5
-10
lines changed

Dockerfile

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ FROM registry.cn-hangzhou.aliyuncs.com/142vip/node:20.17.0-alpine AS build_base
1111
# 是否配置代理
1212
ARG NEED_PROXY=false
1313

14-
## 设置环境变量,支持容器构建时使用layer缓存,参考:https://pnpm.io/zh/docker
14+
# 设置环境变量,支持容器构建时使用layer缓存,参考:https://pnpm.io/zh/docker
1515
ENV PNPM_HOME="/pnpm"
1616
ENV PATH="$PNPM_HOME:$PATH"
1717

@@ -21,10 +21,7 @@ ENV PATH="$PNPM_HOME:$PATH"
2121
WORKDIR /apps
2222
COPY . .
2323

24-
## 安装git,博客编译需要使用git信息
25-
RUN apk add --no-cache git --repository http://mirrors.aliyun.com/alpine/v3.14/main/
26-
27-
## 基于容器自动构建
24+
# 基于容器自动构建
2825
RUN --mount=type=cache,id=pnpm,target=/pnpm/store sh ./scripts/ci && \
2926
if [ "$NEED_PROXY" = "false" ]; \
3027
then \
@@ -33,11 +30,9 @@ RUN --mount=type=cache,id=pnpm,target=/pnpm/store sh ./scripts/ci && \
3330
pnpm build:proxy; \
3431
fi;
3532

33+
FROM registry.cn-hangzhou.aliyuncs.com/142vip/nginx:1.27.0-alpine
3634

37-
FROM registry.cn-hangzhou.aliyuncs.com/142vip/nginx:1.23.0-alpine
38-
39-
40-
## 自定义镜像的Label信息
35+
# 自定义镜像的Label信息
4136
ARG APP_NAME
4237
ARG APP_VERSION
4338
ARG APP_DESCRIPTION

docker-compose.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
version: '2'
66
services:
77
JavaScriptCollection:
8-
image: registry.cn-hangzhou.aliyuncs.com/142vip/docs:JavaScriptCollection-0.0.1
8+
image: registry.cn-hangzhou.aliyuncs.com/142vip/docs:JavaScriptCollection-0.0.2-alpha.21
99
container_name: JavaScriptCollection
1010
hostname: JavaScriptCollection
1111
ports:

0 commit comments

Comments
 (0)