2
0
Эх сурвалжийг харах

Merge remote-tracking branch 'upstream/monorepo' into monorepo

yourname 3 сар өмнө
parent
commit
863702e75e
2 өөрчлөгдсөн 25 нэмэгдсэн , 0 устгасан
  1. 1 0
      .gitignore
  2. 24 0
      Dockerfile

+ 1 - 0
.gitignore

@@ -49,6 +49,7 @@ coverage/
 
 # database backups
 backups/
+backups-prd/
 scripts/time_logger.sh
 loop.txt
 .nfs*

+ 24 - 0
Dockerfile

@@ -12,6 +12,15 @@ ARG WECHAT_PRIVATE_KEY
 ARG WECHAT_MERCHANT_CERT_SERIAL_NO
 ARG WECHAT_PLATFORM_CERT_SERIAL_NO
 
+# 设置软件源为清华大学镜像源
+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@10.18.3
 
@@ -19,9 +28,24 @@ RUN npm install -g pnpm@10.18.3
 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
 
+# 设置备份目录环境变量
+ENV BACKUP_DIR=/app/backups-prd/
 # 复制根目录配置文件
 COPY package.json pnpm-workspace.yaml pnpm-lock.yaml .npmrc ./