Procházet zdrojové kódy

📦 build(Dockerfile): update Dockerfile with new dependencies and configurations

- 设置清华大学镜像源以加速apt包下载
- 安装curl和wget工具
- 添加PostgreSQL 17官方仓库
- 安装PostgreSQL 17客户端工具
- 验证pg_dump版本确保安装正确
yourname před 1 měsícem
rodič
revize
088326505c
1 změnil soubory, kde provedl 22 přidání a 0 odebrání
  1. 22 0
      Dockerfile

+ 22 - 0
Dockerfile

@@ -1,6 +1,15 @@
 # 使用指定基础镜像
 FROM docker.1ms.run/node:20.19.4
 
+# 设置软件源为清华大学镜像源
+RUN echo "deb http://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm main non-free contrib" > /etc/apt/sources.list && \
+    echo "deb http://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-updates main non-free contrib" >> /etc/apt/sources.list && \
+    echo "deb http://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-backports main non-free contrib" >> /etc/apt/sources.list && \
+    echo "deb http://mirrors.tuna.tsinghua.edu.cn/debian-security bookworm-security main non-free contrib" >> /etc/apt/sources.list
+
+RUN apt update  --fix-missing && \
+    apt install -y curl wget
+
 # 安装 pnpm
 RUN npm install -g pnpm
 
@@ -8,6 +17,19 @@ RUN npm install -g pnpm
 RUN pnpm config set registry https://registry.npmmirror.com/
 RUN pnpm config set @jsr:registry https://npm.jsr.io
 
+# 添加PostgreSQL 17的官方仓库
+RUN wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - && \
+    echo "deb http://apt.postgresql.org/pub/repos/apt/ bookworm-pgdg main" > /etc/apt/sources.list.d/pgdg.list
+
+# 更新包列表并安装PostgreSQL 17客户端工具及其他常用工具(已添加jq)
+RUN apt update && \
+    apt install -y \
+    # PostgreSQL 17客户端工具
+    postgresql-client-17
+
+# 确认版本
+RUN pg_dump --version
+
 # 设置工作目录
 WORKDIR /workspace