Update Dockerfile
Browse files- Dockerfile +7 -10
Dockerfile
CHANGED
|
@@ -1,18 +1,15 @@
|
|
| 1 |
# Read the doc: https://huggingface.co/docs/hub/spaces-sdks-docker
|
| 2 |
# you will also find guides on how best to write your Dockerfile
|
| 3 |
|
| 4 |
-
FROM python:3.9
|
| 5 |
-
|
| 6 |
-
RUN useradd -m -u 1000 user
|
| 7 |
-
USER user
|
| 8 |
-
ENV PATH="/home/user/.local/bin:$PATH"
|
| 9 |
|
|
|
|
| 10 |
WORKDIR /app
|
| 11 |
|
| 12 |
-
|
| 13 |
-
|
| 14 |
|
| 15 |
-
|
| 16 |
|
| 17 |
# 暴露端口
|
| 18 |
EXPOSE 8080
|
|
@@ -21,5 +18,5 @@ EXPOSE 8080
|
|
| 21 |
HEALTHCHECK --interval=30s --timeout=5s \
|
| 22 |
CMD curl -f http://localhost:8080/v1/models || exit 1
|
| 23 |
|
| 24 |
-
#
|
| 25 |
-
CMD ["
|
|
|
|
| 1 |
# Read the doc: https://huggingface.co/docs/hub/spaces-sdks-docker
|
| 2 |
# you will also find guides on how best to write your Dockerfile
|
| 3 |
|
| 4 |
+
FROM python:3.9-slim
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5 |
|
| 6 |
+
# 设置工作目录
|
| 7 |
WORKDIR /app
|
| 8 |
|
| 9 |
+
# 复制应用代码
|
| 10 |
+
COPY . .
|
| 11 |
|
| 12 |
+
RUN pip install --no-cache-dir --upgrade -r requirements.txt
|
| 13 |
|
| 14 |
# 暴露端口
|
| 15 |
EXPOSE 8080
|
|
|
|
| 18 |
HEALTHCHECK --interval=30s --timeout=5s \
|
| 19 |
CMD curl -f http://localhost:8080/v1/models || exit 1
|
| 20 |
|
| 21 |
+
# 运行应用
|
| 22 |
+
CMD ["python", "app.py"]
|