Skip to content

Commit

Permalink
Add docker image
Browse files Browse the repository at this point in the history
  • Loading branch information
jkanche committed Jul 19, 2024
1 parent 0257dd4 commit b779200
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 20 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/publish-docker.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Publish Docker image

on:
push:
tags:
- '*'
branches:
- master
workflow_dispatch:

jobs:
publish_docker:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Publish to Registry
uses: elgohr/Publish-Docker-Github-Action@v5
with:
name: ${{ github.repository }}/builder:${{ github.ref_name }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
registry: ghcr.io
2 changes: 1 addition & 1 deletion .github/workflows/publish_python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
build-deploy:
runs-on: ubuntu-latest
Expand Down
20 changes: 3 additions & 17 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Use the bioconductor base image as the starting point
FROM --platform=linux/amd64 bioconductor/bioconductor_docker:devel
FROM --platform=linux/amd64 python:3.11-slim

# Install system dependencies
RUN apt-get update && \
Expand All @@ -8,25 +8,10 @@ RUN apt-get update && \
build-essential \
rsync

# Install Quarto CLI
RUN wget https://github.com/quarto-dev/quarto-cli/releases/download/v1.5.43/quarto-1.5.43-linux-amd64.deb && \
dpkg -i quarto-1.5.43-linux-amd64.deb && \
rm quarto-1.5.43-linux-amd64.deb

# Install TinyTeX
RUN quarto install tinytex

# Install Python dependencies
COPY requirements.txt /requirements.txt
RUN pip install -r /requirements.txt

# Set R environment variable
ENV R_PKG_DIR=${R_HOME}/site-library

# Copy and install R packages
COPY rpackages.R /rpackages.R
RUN Rscript /rpackages.R

# Download and build SQLite3 from source
RUN wget --no-check-certificate https://www.sqlite.org/2024/sqlite-autoconf-3450300.tar.gz && \
tar -xvf sqlite-autoconf-3450300.tar.gz && \
Expand All @@ -47,4 +32,5 @@ COPY . /project
# Set the working directory
WORKDIR /project

RUN quarto render --execute --to html --output-dir build
EXPOSE 8889
CMD ["jupyter", "lab", "--allow-root", "--ip=0.0.0.0", "--port=8889", "--no-browser"]
11 changes: 10 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,13 @@ Rscript rpackages.R
qurto preview
```

Take advantage of GitHub actions, which are available to automatically publish the tutorial book whenever changes are made on the **master** branch.
GitHub actions automatically publish the tutorial book whenever changes are made on the **master** branch.

## Dockerfile

To build the docker image, (defaults to port 8889)

```sh
docker build -t bioc .
docker run -it -p 8889:8889 bioc
```
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ singler>=0.2.0
numpy
scipy
pandas
jupyterlab
jupyter
jupyter-cache
rich
jupyterlab
seaborn
session-info
celldex
Expand Down

0 comments on commit b779200

Please sign in to comment.