Skip to content

Commit d402bcf

Browse files
committed
ci: set up container env for jupyter notebook
1 parent 21d6085 commit d402bcf

File tree

1 file changed

+31
-3
lines changed

1 file changed

+31
-3
lines changed

ContainerFile

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,18 +56,46 @@ RUN conda config --add channels conda-forge \
5656
&& conda config --add channels bioconda \
5757
&& conda install -y \
5858
python=3.9 \
59+
ipython=8.22.0 \
60+
notebook \
5961
biopython \
62+
pysam \
63+
seaborn \
64+
plotly \
65+
python-kaleido \
6066
bwa \
6167
samtools \
6268
velvet \
6369
bcftools=1.15 \
6470
kraken2 \
6571
&& conda clean -afy
6672

73+
# ────── Generate and tweak Jupyter defaults ──────
74+
RUN jupyter notebook --generate-config \
75+
&& sed -i \
76+
-e "s|#c.NotebookApp.ip = 'localhost'|c.NotebookApp.ip = '0.0.0.0'|" \
77+
-e "s|#c.NotebookApp.open_browser = True|c.NotebookApp.open_browser = False|" \
78+
~/.jupyter/jupyter_notebook_config.py \
79+
&& printf "\
80+
c.NotebookApp.token = ''\n\
81+
c.NotebookApp.password = ''\n\
82+
c.NotebookApp.allow_root = True\n" \
83+
>> ~/.jupyter/jupyter_notebook_config.py
6784

6885
# 2.2 Copy the compiled binary in
6986
COPY --from=builder /usr/local/bin/popins4snake /usr/local/bin/
7087
COPY --from=builder /usr/local/bin/sickle /usr/local/bin/
71-
# 2.3 Default entrypoint: show help
72-
ENTRYPOINT ["popins4snake"]
73-
CMD ["--help"]
88+
89+
# 2.3 Expose Jupyter’s default port
90+
EXPOSE 8888
91+
92+
# 2.4 one-liner to start notebook
93+
RUN printf '#!/usr/bin/env bash\nexec jupyter notebook\n' \
94+
> /usr/local/bin/start-notebook \
95+
&& chmod +x /usr/local/bin/start-notebook
96+
97+
# # 2.3 Default entrypoint: show help
98+
# ENTRYPOINT ["jupyter", "notebook", "--ip=0.0.0.0", "--no-browser", "--allow-root"]
99+
# CMD ["--NotebookApp.token=''", "--NotebookApp.password=''", "--NotebookApp.notebook_dir=/"]
100+
# ENTRYPOINT ["popins4snake"]
101+
# CMD ["--help"]

0 commit comments

Comments
 (0)