File size: 719 Bytes
b751abe 15df441 b751abe 15df441 499082b 15df441 499082b 15df441 499082b 15df441 499082b 15df441 b751abe 15df441 b751abe |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
FROM rocker/r-base:latest
# 设置工作目录
WORKDIR /code
# 安装系统依赖
RUN apt-get update && apt-get install -y \
libcurl4-openssl-dev \
libssl-dev \
libxml2-dev \
libgdal-dev \
libgeos-dev \
libproj-dev \
libnetcdf-dev \
&& rm -rf /var/lib/apt/lists/*
# 安装 R 包
RUN R -e "install.packages('remotes')" \
&& R -e "remotes::install_cran('shiny')" \
&& R -e "remotes::install_cran('dplyr')" \
&& R -e "remotes::install_cran('sf')" \
&& R -e "remotes::install_cran('stringr')" \
&& R -e "remotes::install_cran('leaflet')"
# 复制应用代码
COPY . .
# 设置容器启动命令
CMD ["R", "--quiet", "-e", "shiny::runApp(host='0.0.0.0', port=7860)"]
|