-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4b6a8ea
commit 6461f3d
Showing
1 changed file
with
6 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
FROM r-base:latest | ||
LABEL maintainer="Yen-Chieh Liao <[email protected]>" | ||
|
||
|
||
# 安裝系統依賴 | ||
RUN apt-get update && apt-get install -y \ | ||
python3 \ | ||
|
@@ -17,18 +18,19 @@ RUN python3 -m venv /opt/venv | |
# 在虛擬環境中安裝 Flair | ||
RUN /opt/venv/bin/pip install flair | ||
|
||
# 安裝 R 依賴項 | ||
# 安裝 R 依賴項 和 flaiR 包 | ||
RUN R -e "install.packages(c('remotes', \ | ||
'data.table', 'reticulate', 'curl', 'attempt', 'htmltools', 'stringr', \ | ||
'knitr', 'rmarkdown', 'lsa', 'purrr', 'jsonlite', 'ggplot2', 'plotly', 'testthat'), \ | ||
repos='https://cloud.r-project.org/')" | ||
repos='https://cloud.r-project.org/')" && \ | ||
R -e "remotes::install_github('davidycliao/flaiR', force = TRUE)" | ||
|
||
# 複製你的 R 包源碼到容器中 | ||
COPY . /pkg | ||
WORKDIR /pkg | ||
|
||
# 從本地安裝套件 | ||
RUN R -e "remotes::install_local('/pkg', force = TRUE)" | ||
# 從本地安裝套件(如果需要) | ||
# RUN R -e "remotes::install_local('/pkg', force = TRUE)" # 注释掉这行,因为我们已经从 GitHub 安装了 | ||
|
||
# 設定預設命令 | ||
CMD ["R"] |