Skip to content

Commit

Permalink
Merge pull request #243 from davidycliao/0.0.7
Browse files Browse the repository at this point in the history
0.0.7
  • Loading branch information
davidycliao authored Dec 30, 2024
2 parents 090fe77 + cd532fc commit 952ab11
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ jobs:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2


- name: Build and push Docker image
uses: docker/build-push-action@v4
with:
Expand All @@ -78,4 +79,3 @@ jobs:
ghcr.io/${{ github.repository_owner }}/flair:${{ github.sha }}
cache-from: type=gha
cache-to: type=gha,mode=max

20 changes: 7 additions & 13 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,17 @@ RUN apt-get update && apt-get install -y \
# 創建虛擬環境
RUN python3 -m venv /opt/venv

# 在虛擬環境中安裝 Flair (注意這裡改用完整路徑)
# 在虛擬環境中安裝 Flair
RUN /opt/venv/bin/pip install flair

# 安裝 R 依賴項
RUN R -e "install.packages('remotes')"
RUN R -e "install.packages(c('data.table', 'reticulate', 'curl', 'attempt', 'htmltools', 'stringr'))"
RUN R -e "install.packages(c('knitr', 'rmarkdown', 'lsa', 'purrr', 'jsonlite', 'ggplot2', 'plotly', 'testthat'))"
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/')"

# 複製 R 套件到容器中
COPY . /usr/src/my_pkg
WORKDIR /usr/src/my_pkg

# 安裝 R 套件
RUN R -e "remotes::install_local(force = TRUE)"

# 清理不必要的文件
RUN rm -rf /usr/src/my_pkg
# 從 GitHub 安裝 flaiR
RUN R -e "remotes::install_github('davidycliao/flaiR', force = TRUE)"

# 設定預設命令
CMD ["R"]

0 comments on commit 952ab11

Please sign in to comment.