Dockerfile: add set -ex debug output
Browse files- Dockerfile +16 -7
Dockerfile
CHANGED
|
@@ -3,27 +3,36 @@ FROM python:3.11
|
|
| 3 |
ENV DEBIAN_FRONTEND=noninteractive
|
| 4 |
ENV PIP_NO_CACHE_DIR=1
|
| 5 |
|
| 6 |
-
#
|
| 7 |
-
RUN
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
wget xz-utils ca-certificates \
|
| 9 |
libxi6 libxext6 libxrender1 libxfixes3 libxxf86vm1 \
|
| 10 |
libxkbcommon0 libsm6 libgl1 libglu1-mesa \
|
| 11 |
-
|
|
|
|
| 12 |
|
| 13 |
# Blender 4.2.9 LTS
|
| 14 |
ARG BLENDER_VERSION=4.2.9
|
| 15 |
-
RUN
|
|
|
|
| 16 |
&& tar -xf /tmp/blender.tar.xz -C /opt \
|
| 17 |
&& mv /opt/blender-${BLENDER_VERSION}-linux-x64 /opt/blender \
|
| 18 |
-
&& rm /tmp/blender.tar.xz
|
|
|
|
|
|
|
|
|
|
| 19 |
ENV PATH="/opt/blender:${PATH}"
|
| 20 |
|
| 21 |
-
# HF 非 root 用户
|
| 22 |
RUN useradd -m -u 1000 appuser
|
| 23 |
WORKDIR /app
|
| 24 |
|
| 25 |
COPY requirements.txt .
|
| 26 |
-
RUN pip install -r requirements.txt
|
| 27 |
|
| 28 |
COPY app.py worker.py ./
|
| 29 |
|
|
|
|
| 3 |
ENV DEBIAN_FRONTEND=noninteractive
|
| 4 |
ENV PIP_NO_CACHE_DIR=1
|
| 5 |
|
| 6 |
+
# 显式源 + 调试输出
|
| 7 |
+
RUN set -ex \
|
| 8 |
+
&& echo "deb http://deb.debian.org/debian bookworm main" > /etc/apt/sources.list \
|
| 9 |
+
&& echo "deb http://deb.debian.org/debian-security bookworm-security main" >> /etc/apt/sources.list \
|
| 10 |
+
&& echo "deb http://deb.debian.org/debian bookworm-updates main" >> /etc/apt/sources.list \
|
| 11 |
+
&& apt-get update \
|
| 12 |
+
&& apt-get install -y --no-install-recommends \
|
| 13 |
wget xz-utils ca-certificates \
|
| 14 |
libxi6 libxext6 libxrender1 libxfixes3 libxxf86vm1 \
|
| 15 |
libxkbcommon0 libsm6 libgl1 libglu1-mesa \
|
| 16 |
+
&& rm -rf /var/lib/apt/lists/* \
|
| 17 |
+
&& echo "=== APT packages installed ==="
|
| 18 |
|
| 19 |
# Blender 4.2.9 LTS
|
| 20 |
ARG BLENDER_VERSION=4.2.9
|
| 21 |
+
RUN set -ex \
|
| 22 |
+
&& wget -q "https://download.blender.org/release/Blender4.2/blender-${BLENDER_VERSION}-linux-x64.tar.xz" -O /tmp/blender.tar.xz \
|
| 23 |
&& tar -xf /tmp/blender.tar.xz -C /opt \
|
| 24 |
&& mv /opt/blender-${BLENDER_VERSION}-linux-x64 /opt/blender \
|
| 25 |
+
&& rm /tmp/blender.tar.xz \
|
| 26 |
+
&& /opt/blender/blender --version \
|
| 27 |
+
&& echo "=== Blender installed ==="
|
| 28 |
+
|
| 29 |
ENV PATH="/opt/blender:${PATH}"
|
| 30 |
|
|
|
|
| 31 |
RUN useradd -m -u 1000 appuser
|
| 32 |
WORKDIR /app
|
| 33 |
|
| 34 |
COPY requirements.txt .
|
| 35 |
+
RUN set -ex && pip install -r requirements.txt && echo "=== Python deps installed ==="
|
| 36 |
|
| 37 |
COPY app.py worker.py ./
|
| 38 |
|