Skip to content

Commit

Permalink
Add dockerfile (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
jkanche authored Jul 19, 2024
1 parent f858c68 commit e1f6693
Show file tree
Hide file tree
Showing 6 changed files with 68 additions and 3 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/publish-docker.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Publish Docker image

on:
push:
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
36 changes: 36 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Use the bioconductor base image as the starting point
FROM --platform=linux/amd64 python:3.11-slim

# Install system dependencies
RUN apt-get update && \
apt-get install -y \
wget \
build-essential \
rsync

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

# 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 && \
cd sqlite-autoconf-3450300 && \
./configure && \
make && \
make install && \
export PATH="/usr/local/lib:$PATH" && \
cd .. && \
rm -rf sqlite-autoconf-3450300.tar.gz sqlite-autoconf-3450300

# Set environment variable for LD_LIBRARY_PATH
ENV LD_LIBRARY_PATH=/usr/local/lib

# Copy the project files into the Docker image
COPY . /project

# Set the working directory
WORKDIR /project

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
```
Binary file modified assets/workshop.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 e1f6693

Please sign in to comment.