Update Dockerfile
Browse files- Dockerfile +3 -1
Dockerfile
CHANGED
|
@@ -8,11 +8,13 @@ ENV DEBIAN_FRONTEND=noninteractive \
|
|
| 8 |
PYTHONIOENCODING=UTF-8 \
|
| 9 |
PORT=7860
|
| 10 |
|
|
|
|
| 11 |
RUN apt-get update && apt-get install -y --no-install-recommends \
|
| 12 |
curl ca-certificates \
|
| 13 |
libstdc++6 libgomp1 \
|
| 14 |
libxrender1 libxext6 \
|
| 15 |
tini \
|
|
|
|
| 16 |
&& rm -rf /var/lib/apt/lists/*
|
| 17 |
|
| 18 |
WORKDIR /app
|
|
@@ -30,7 +32,7 @@ COPY --chown=user:user . /app
|
|
| 30 |
# 切换到非root用户执行后续操作
|
| 31 |
USER user
|
| 32 |
|
| 33 |
-
# 预下载STOUT模型权重,避免API首次请求超时
|
| 34 |
RUN python -c "from STOUT import translate_forward; print('Pre-loading model...'); translate_forward('C'); print('Complete.')"
|
| 35 |
|
| 36 |
EXPOSE $PORT
|
|
|
|
| 8 |
PYTHONIOENCODING=UTF-8 \
|
| 9 |
PORT=7860
|
| 10 |
|
| 11 |
+
# 这里在依赖列表中增加了 default-jre-headless
|
| 12 |
RUN apt-get update && apt-get install -y --no-install-recommends \
|
| 13 |
curl ca-certificates \
|
| 14 |
libstdc++6 libgomp1 \
|
| 15 |
libxrender1 libxext6 \
|
| 16 |
tini \
|
| 17 |
+
default-jre-headless \
|
| 18 |
&& rm -rf /var/lib/apt/lists/*
|
| 19 |
|
| 20 |
WORKDIR /app
|
|
|
|
| 32 |
# 切换到非root用户执行后续操作
|
| 33 |
USER user
|
| 34 |
|
| 35 |
+
# 预下载STOUT模型权重和CDK库,避免API首次请求超时
|
| 36 |
RUN python -c "from STOUT import translate_forward; print('Pre-loading model...'); translate_forward('C'); print('Complete.')"
|
| 37 |
|
| 38 |
EXPOSE $PORT
|