Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

0.0.7 #243

Merged
merged 6 commits into from
Dec 30, 2024
Merged

0.0.7 #243

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,14 @@ 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:
context: .
push: true
tags: |
ghcr.io/${{ github.repository }}:latest
ghcr.io/${{ github.repository }}:${{ github.sha }}
ghcr.io/${{ github.repository_owner }}/flair:latest
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"]
Loading