Explorar el Código

Merge branch 'feature/2025-0728-fix-dockerfile' of Server/LongArticleTaskServer into master

luojunhui hace 1 mes
padre
commit
f607886e8d
Se han modificado 2 ficheros con 18 adiciones y 6 borrados
  1. 11 6
      Dockerfile
  2. 7 0
      dev.py

+ 11 - 6
Dockerfile

@@ -1,13 +1,19 @@
 FROM python:3.11-slim
+
 WORKDIR /app
 
-ENV PYTHONDONTWRITEBYTECODE 1
-ENV PYTHONUNBUFFERED 1
+ENV PYTHONDONTWRITEBYTECODE=1
+ENV PYTHONUNBUFFERED=1
 ENV PIP_DISABLE_PIP_VERSION_CHECK=on
+ENV NVM_DIR=/root/.nvm
 
-RUN apt-get update && \
-    apt-get install -y --no-install-recommends gcc libpq-dev && \
-    rm -rf /var/lib/apt/lists/*
+# 安装 Node.js(推荐安装官方 LTS 版本)并安装 jsdom
+RUN apt-get update && apt-get install -y curl gnupg ca-certificates \
+    && curl -fsSL https://deb.nodesource.com/setup_20.x | bash - \
+    && apt-get install -y nodejs \
+    && npm install jsdom \
+    && apt-get clean \
+    && rm -rf /var/lib/apt/lists/*
 
 COPY requirements.txt .
 RUN pip install --no-cache-dir -r requirements.txt
@@ -17,4 +23,3 @@ COPY . .
 EXPOSE 6060
 
 CMD ["hypercorn", "task_app:app", "--config", "app_config.toml"]
-

La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 7 - 0
dev.py


Algunos archivos no se mostraron porque demasiados archivos cambiaron en este cambio