From f134416d4a1e569999ef5e981bfcc052d817a5c1 Mon Sep 17 00:00:00 2001 From: "cnb.asek4HHRAKA" Date: Wed, 1 Oct 2025 19:43:35 +0800 Subject: [PATCH] =?UTF-8?q?add:=20=E6=96=B0=E5=A2=9E=20.editconfig=20?= =?UTF-8?q?=E7=BB=9F=E4=B8=80=E7=BC=96=E8=BE=91=E5=99=A8=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=EF=BC=8C=E6=9B=B4=E6=96=B0=20Dockerfile=20=E4=BD=BF=E7=94=A8?= =?UTF-8?q?=20Python=203.12=20=E5=92=8C=20Beancount=203.2.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .editconfig | 89 ++++++++++++++++++++++++++++++++++++++++++++++++++ lib/Dockerfile | 12 +++---- 2 files changed, 95 insertions(+), 6 deletions(-) create mode 100644 .editconfig diff --git a/.editconfig b/.editconfig new file mode 100644 index 0000000..f77f5d0 --- /dev/null +++ b/.editconfig @@ -0,0 +1,89 @@ +# EditorConfig is awesome: https://EditorConfig.org + +# 这是顶级文件 +root = true + +# 所有文件的默认设置 +[*] +charset = utf-8 +end_of_line = lf +insert_final_newline = true +indent_style = space +indent_size = 2 +trim_trailing_whitespace = true + +# Markdown 文件特定设置 +[*.md] +max_line_length = off +trim_trailing_whitespace = false + +# YAML 文件特定设置 +[*.{yml,yaml}] +indent_size = 2 + +# JSON 文件特定设置 +[*.json] +indent_size = 2 + +# Python 文件特定设置 +[*.py] +indent_size = 4 +max_line_length = 88 + +# JavaScript/TypeScript 文件特定设置 +[*.{js,jsx,ts,tsx}] +indent_size = 2 +max_line_length = 100 + +# CSS/SCSS 文件特定设置 +[*.{css,scss}] +indent_size = 2 + +# HTML 文件特定设置 +[*.html] +indent_size = 2 + +# Shell 脚本特定设置 +[*.sh] +indent_size = 2 + +# XML 文件特定设置 +[*.xml] +indent_size = 2 + +# Makefile 特定设置 +[Makefile] +indent_style = tab + +# Go 文件特定设置 +[*.go] +indent_style = tab +indent_size = 4 + +# Java 文件特定设置 +[*.java] +indent_size = 4 + +# C/C++ 文件特定设置 +[*.{c,cpp,h,hpp}] +indent_size = 4 + +# PHP 文件特定设置 +[*.php] +indent_size = 4 + +# Ruby 文件特定设置 +[*.rb] +indent_size = 2 + +# SQL 文件特定设置 +[*.sql] +indent_size = 2 + +# Dockerfile 特定设置 +[Dockerfile] +indent_size = 4 + +# Vue 文件特定设置 +[*.vue] +indent_size = 2 diff --git a/lib/Dockerfile b/lib/Dockerfile index 2044ab1..daf83c0 100644 --- a/lib/Dockerfile +++ b/lib/Dockerfile @@ -1,5 +1,5 @@ -# 第一阶段:构建阶段 -FROM python:3.11.9-alpine3.19 as builder +# 第一阶段:构建阶段 python:3.12-alpine3.22 +FROM python:3.12-alpine3.22 as builder # 设置环境变量,防止 Python 创建 .pyc 文件 ENV PYTHONUNBUFFERED=1 @@ -20,21 +20,21 @@ WORKDIR /app RUN python3 -m venv /app/venv # 将 Beancount 源码压缩包复制到容器中 -COPY beancount-2.3.6.tar.gz /app +COPY beancount-3.2.0.tar.gz /app # 解压 Beancount 源码到 /beancount 目录 RUN mkdir /beancount && \ - tar -xzf /app/beancount-2.3.6.tar.gz -C /beancount --strip-components=1 + tar -xzf /app/beancount-3.2.0.tar.gz -C /beancount --strip-components=1 # 激活虚拟环境并安装 Beancount RUN /app/venv/bin/pip install --upgrade pip -i https://mirrors.aliyun.com/pypi/simple/ && \ /app/venv/bin/pip install /beancount -i https://mirrors.aliyun.com/pypi/simple/ && \ # 清理不必要的文件 - rm -rf /app/beancount-2.3.6.tar.gz && \ + rm -rf /app/beancount-3.2.0.tar.gz && \ find /app -name __pycache__ -exec rm -rf -v {} + # 第二阶段:运行阶段 -FROM python:3.11.9-alpine3.19 +FROM python:3.12-alpine3.22 # 设置环境变量,防止 Python 创建 .pyc 文件 ENV PYTHONUNBUFFERED=1