Update Dockerfile
Browse files- Dockerfile +16 -7
Dockerfile
CHANGED
|
@@ -1,9 +1,18 @@
|
|
| 1 |
-
FROM
|
| 2 |
USER root
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
wget \
|
| 6 |
-
|
| 7 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
EXPOSE 5244
|
| 9 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
FROM python:3.11-slim
|
| 2 |
USER root
|
| 3 |
+
WORKDIR /data
|
| 4 |
+
RUN apt-get update && apt-get install -y --no-install-recommends \
|
| 5 |
+
git gcc g++ make curl wget net-tools \
|
| 6 |
+
&& rm -rf /var/lib/apt/lists/*
|
| 7 |
+
RUN git clone https://github.com/openlit/openlit.git /app
|
| 8 |
+
WORKDIR /app
|
| 9 |
+
RUN pip install --no-cache-dir -e .[all]
|
| 10 |
+
ENV OPENLIT_DATA_DIR=/data
|
| 11 |
+
ENV OPENLIT_UPLOAD_DIR=/data/uploads
|
| 12 |
+
ENV OPENLIT_STORAGE_DIR=/data/storage
|
| 13 |
EXPOSE 5244
|
| 14 |
+
VOLUME ["/data"] # 显式声明/data为持久化卷,HF强制保留
|
| 15 |
+
CMD ["openlit", "serve", \
|
| 16 |
+
"--host", "0.0.0.0", \
|
| 17 |
+
"--port", "5244", \
|
| 18 |
+
"--root-path", "/"]
|