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