File tree Expand file tree Collapse file tree 3 files changed +47
-9
lines changed
Expand file tree Collapse file tree 3 files changed +47
-9
lines changed Original file line number Diff line number Diff line change 11FROM node:24-slim AS base
22
3- # 基础环境
4- ENV PNPM_HOME="/home/node/.pnpm-store"
5- ENV PATH="$PNPM_HOME:$PATH"
6-
7- USER root
8-
9- # 安装 pnpm
10- RUN corepack enable && corepack prepare pnpm@latest --activate
11-
3+ # ================== postgres client install begin ==================
124# 安装基础依赖
135RUN apt-get update && apt-get install -y \
146 curl \
@@ -25,6 +17,14 @@ RUN curl -fSsL https://www.postgresql.org/media/keys/ACCC4CF8.asc | gpg --dearmo
2517RUN apt-get update && \
2618 apt-get install -y postgresql-client-18 && \
2719 rm -rf /var/lib/apt/lists/*
20+ # ================== postgres client install end ==================
21+
22+ # 基础环境
23+ ENV PNPM_HOME="/home/node/.pnpm-store"
24+ ENV PATH="$PNPM_HOME:$PATH"
25+
26+ # 安装 pnpm
27+ RUN corepack enable && corepack prepare pnpm@latest --activate
2828
2929# 依赖安装阶段
3030FROM base AS deps
Original file line number Diff line number Diff line change 11FROM node:24-slim
22
3+ # ================== postgres client install begin ==================
4+ # 安装基础依赖
5+ RUN apt-get update && apt-get install -y \
6+ curl \
7+ ca-certificates \
8+ gnupg \
9+ lsb-release \
10+ --no-install-recommends
11+
12+ # 导入 PostgreSQL 官方 GPG 密钥并设置存储库
13+ RUN curl -fSsL https://www.postgresql.org/media/keys/ACCC4CF8.asc | gpg --dearmor -o /usr/share/keyrings/postgresql-archive-keyring.gpg && \
14+ echo "deb [signed-by=/usr/share/keyrings/postgresql-archive-keyring.gpg] http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list
15+
16+ # 安装 PostgreSQL 18 客户端
17+ RUN apt-get update && \
18+ apt-get install -y postgresql-client-18 && \
19+ rm -rf /var/lib/apt/lists/*
20+ # ================== postgres client install end ==================
21+
322WORKDIR /app
423ENV NODE_ENV=production
524
Original file line number Diff line number Diff line change 11FROM node:24-slim
22
3+ # ================== postgres client install begin ==================
4+ # 安装基础依赖
5+ RUN apt-get update && apt-get install -y \
6+ curl \
7+ ca-certificates \
8+ gnupg \
9+ lsb-release \
10+ --no-install-recommends
11+
12+ # 导入 PostgreSQL 官方 GPG 密钥并设置存储库
13+ RUN curl -fSsL https://www.postgresql.org/media/keys/ACCC4CF8.asc | gpg --dearmor -o /usr/share/keyrings/postgresql-archive-keyring.gpg && \
14+ echo "deb [signed-by=/usr/share/keyrings/postgresql-archive-keyring.gpg] http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list
15+
16+ # 安装 PostgreSQL 18 客户端
17+ RUN apt-get update && \
18+ apt-get install -y postgresql-client-18 && \
19+ rm -rf /var/lib/apt/lists/*
20+ # ================== postgres client install end ==================
21+
322WORKDIR /app
423ENV NODE_ENV=production
524
You can’t perform that action at this time.
0 commit comments