fuxialexander commited on
Commit
64cee5e
·
1 Parent(s): cba835b
Files changed (2) hide show
  1. Dockerfile +8 -0
  2. app/main.py +10 -2
Dockerfile CHANGED
@@ -17,5 +17,13 @@ COPY --chown=$MAMBA_USER:$MAMBA_USER app/main.py /app/main.py
17
  # Make port 80 available to the world outside this container
18
  EXPOSE 7860
19
 
 
 
 
 
 
 
 
20
  # Command to run the Gradio app automatically
21
  CMD ["/opt/conda/bin/python", "main.py"]
 
 
17
  # Make port 80 available to the world outside this container
18
  EXPOSE 7860
19
 
20
+ # Set environment variable for Matplotlib cache directory
21
+ ENV MPLCONFIGDIR=/app/matplotlib_cache
22
+
23
+ # Create the directory for Matplotlib cache
24
+ RUN mkdir -p /app/matplotlib_cache && chown $MAMBA_USER:$MAMBA_USER /app/matplotlib_cache
25
+ RUN mkdir -p /app/.gcell_data && chown $MAMBA_USER:$MAMBA_USER /app/.gcell_data
26
+
27
  # Command to run the Gradio app automatically
28
  CMD ["/opt/conda/bin/python", "main.py"]
29
+
app/main.py CHANGED
@@ -1,17 +1,25 @@
1
  # Demo app
2
  from pathlib import Path
3
 
 
 
 
 
 
 
 
 
 
4
  import gradio as gr
5
  import matplotlib.pyplot as plt
6
  import pandas as pd
7
  import s3fs
8
- from genomespy import GenomeSpy
9
-
10
  from gcell.cell.celltype import GETCellType
11
  from gcell.config.config import load_config
12
  from gcell.dna.nr_motif_v1 import NrMotifV1
13
  from gcell.protein.af2 import AFPairseg
14
  from gcell.utils.pdb_viewer import view_pdb_html
 
15
 
16
  gs = GenomeSpy()
17
 
 
1
  # Demo app
2
  from pathlib import Path
3
 
4
+ SETTINGS = {
5
+ "annotation_dir": str(Path("/app/.gcell_data") / "annotations"),
6
+ "genome_dir": str(Path("/app/.gcell_data") / "genomes"),
7
+ "cache_dir": str(Path("/app/.gcell_data") / "cache"),
8
+ }
9
+
10
+ from gcell._settings import update_settings
11
+
12
+ update_settings(SETTINGS)
13
  import gradio as gr
14
  import matplotlib.pyplot as plt
15
  import pandas as pd
16
  import s3fs
 
 
17
  from gcell.cell.celltype import GETCellType
18
  from gcell.config.config import load_config
19
  from gcell.dna.nr_motif_v1 import NrMotifV1
20
  from gcell.protein.af2 import AFPairseg
21
  from gcell.utils.pdb_viewer import view_pdb_html
22
+ from genomespy import GenomeSpy
23
 
24
  gs = GenomeSpy()
25