Shunfeng Zheng commited on
Commit
1569ae5
·
verified ·
1 Parent(s): 2800401

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +21 -20
Dockerfile CHANGED
@@ -1,24 +1,25 @@
1
- FROM ghcr.io/livebook-dev/livebook:latest-cuda12
2
 
3
- ENV LIVEBOOK_APP_SERVICE_NAME="🐳 Hugging Face - $SPACE_TITLE"
4
- ENV LIVEBOOK_APP_SERVICE_URL="https://huggingface.co/spaces/$SPACE_AUTHOR_NAME/$SPACE_REPO_NAME"
5
- ENV LIVEBOOK_UPDATE_INSTRUCTIONS_URL="https://livebook.dev"
6
- ENV LIVEBOOK_WITHIN_IFRAME="true"
7
- ENV LIVEBOOK_APPS_PATH="/public-apps"
8
- ENV LIVEBOOK_APPS_PATH_WARMUP="manual"
9
- ENV LIVEBOOK_DATA_PATH="/data"
10
- ENV LIVEBOOK_PORT="7860"
 
 
 
 
11
 
12
- EXPOSE 7860
 
 
13
 
14
- RUN mkdir -p /data
15
- RUN chmod 777 /data
 
16
 
17
- # The Space container runs with user ID 1000
18
- RUN useradd -m -u 1000 user
19
- ENV HOME="/home/user"
20
-
21
- USER user
22
-
23
- COPY --chown=user public-apps/ /public-apps
24
- RUN /app/bin/warmup_apps
 
1
+ FROM python:3.10-slim
2
 
3
+ # 安装系统依赖(GDAL、shapely、geopandas 需要)
4
+ RUN apt-get update && apt-get install -y \
5
+ build-essential \
6
+ g++ \
7
+ git \
8
+ curl \
9
+ gcc \
10
+ gdal-bin \
11
+ libgdal-dev \
12
+ libgeos-dev \
13
+ libspatialindex-dev \
14
+ && rm -rf /var/lib/apt/lists/*
15
 
16
+ # 复制文件
17
+ WORKDIR /app
18
+ COPY . .
19
 
20
+ # 安装 Python 依赖
21
+ RUN pip install --upgrade pip
22
+ RUN pip install --no-deps -r requirements_geospacy.txt
23
 
24
+ # 设置 Streamlit 默认运行
25
+ CMD ["streamlit", "run", "app.py", "--server.port=7860", "--server.address=0.0.0.0"]