Skip to content

Commit

Permalink
Update Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
davidycliao authored Dec 30, 2024
1 parent 4b6a8ea commit 6461f3d
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
FROM r-base:latest
LABEL maintainer="Yen-Chieh Liao <davidycliao@gmail.com>"


# 安裝系統依賴
RUN apt-get update && apt-get install -y \
python3 \
Expand All @@ -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"]

0 comments on commit 6461f3d

Please sign in to comment.