File tree Expand file tree Collapse file tree 2 files changed +90
-1
lines changed Expand file tree Collapse file tree 2 files changed +90
-1
lines changed Original file line number Diff line number Diff line change 1+ name : Build and Push Docker Image
2+
3+ on :
4+ push :
5+ branches :
6+ - main
7+ tags :
8+ - ' v*'
9+ pull_request :
10+ branches :
11+ - main
12+
13+ env :
14+ REGISTRY : ghcr.io
15+ IMAGE_NAME : ${{ github.repository }}
16+
17+ jobs :
18+ build-and-push :
19+ runs-on : ubuntu-latest
20+ permissions :
21+ contents : read
22+ packages : write
23+
24+ steps :
25+ - name : Checkout repository
26+ uses : actions/checkout@v4
27+
28+ - name : Set up Docker Buildx
29+ uses : docker/setup-buildx-action@v3
30+
31+ - name : Log in to GitHub Container Registry
32+ if : github.event_name != 'pull_request'
33+ uses : docker/login-action@v3
34+ with :
35+ registry : ${{ env.REGISTRY }}
36+ username : ${{ github.actor }}
37+ password : ${{ secrets.GITHUB_TOKEN }}
38+
39+ - name : Extract metadata (tags, labels)
40+ id : meta
41+ uses : docker/metadata-action@v5
42+ with :
43+ images : ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
44+ tags : |
45+ type=ref,event=branch
46+ type=ref,event=pr
47+ type=semver,pattern={{version}}
48+ type=semver,pattern={{major}}.{{minor}}
49+ type=semver,pattern={{major}}
50+ type=sha
51+
52+ - name : Build and push Docker image
53+ uses : docker/build-push-action@v5
54+ with :
55+ context : .
56+ push : ${{ github.event_name != 'pull_request' }}
57+ tags : ${{ steps.meta.outputs.tags }}
58+ labels : ${{ steps.meta.outputs.labels }}
59+ cache-from : type=gha
60+ cache-to : type=gha,mode=max
Original file line number Diff line number Diff line change @@ -44,9 +44,38 @@ The app will be available at `http://localhost:8080`
4444 ]
4545 ```
4646
47+ 3 . The ` public/config.json ` file is gitignored to keep credentials safe.
48+
4749## Docker Deployment
4850
49- When deploying with Docker, mount your ` config.json ` as a volume:
51+ ### Using Pre-built Image from GHCR
52+
53+ Pull and run the latest image from GitHub Container Registry:
54+
55+ ``` bash
56+ docker run -d -p 8080:80 \
57+ -v $( pwd) /public/config.json:/usr/share/nginx/html/config.json:ro \
58+ ghcr.io/mskcc/cellxgene-dash:main
59+ ```
60+
61+ Or update ` docker-compose.yml ` to use the pre-built image:
62+
63+ ``` yaml
64+ version : ' 3.8'
65+
66+ services :
67+ cellxgene-dash :
68+ image : ghcr.io/mskcc/cellxgene-dash:main
69+ ports :
70+ - " 8080:80"
71+ volumes :
72+ - ./public/config.json:/usr/share/nginx/html/config.json:ro
73+ restart : unless-stopped
74+ ` ` `
75+
76+ ### Building Locally
77+
78+ When building locally, mount your ` config.json` as a volume:
5079
5180` ` ` bash
5281docker run -d -p 8080:80 \
You can’t perform that action at this time.
0 commit comments