mirror of
https://github.com/Novartis/cellxgene-gateway.git
synced 2026-09-15 12:47:59 +08:00
#79 add simple example to customize cellxgene-gateway ui
This commit is contained in:
12
examples/customized_docker_image/Dockerfile
Normal file
12
examples/customized_docker_image/Dockerfile
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
FROM python:3.9
|
||||||
|
|
||||||
|
RUN pip install cellxgene-gateway 'MarkupSafe<2.1'
|
||||||
|
|
||||||
|
COPY customize_ui.sh customize_ui.sh
|
||||||
|
RUN CELLXGENE_GATEWAY_DIR=/usr/local/lib/python3.9/site-packages/cellxgene_gateway . ./customize_ui.sh
|
||||||
|
|
||||||
|
ENV CELLXGENE_DATA=/cellxgene-data
|
||||||
|
ENV CELLXGENE_LOCATION=/usr/local/bin/cellxgene
|
||||||
|
EXPOSE 5005
|
||||||
|
|
||||||
|
CMD ["cellxgene-gateway"]
|
||||||
13
examples/customized_docker_image/README.md
Normal file
13
examples/customized_docker_image/README.md
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
# Purpose
|
||||||
|
|
||||||
|
This is a simple example of how to make a small script to customize the UI of cellxgene-gateway. The script that does the customization is `customize_ui.sh`, it simply makes the main header green using CSS but you could do anything you want there (including adding more script tags, etc).
|
||||||
|
|
||||||
|
# Usage
|
||||||
|
|
||||||
|
```
|
||||||
|
docker build -t cellxgene_custom .
|
||||||
|
docker run -p 5005:5005 cellxgene_custom
|
||||||
|
```
|
||||||
|
|
||||||
|
If you now open http://localhost:5005 you should see a green cellxgene gateway header.
|
||||||
|
|
||||||
3
examples/customized_docker_image/customize_ui.sh
Normal file
3
examples/customized_docker_image/customize_ui.sh
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
# make the header bright green
|
||||||
|
find "${CELLXGENE_GATEWAY_DIR}/templates" -name index.html -exec sed -i -e 's/<head>/<head>\
|
||||||
|
> <style> header h3 {color: #0F0;} <\/style>/g' {} \;
|
||||||
Reference in New Issue
Block a user