Nicky Nicolson commited on
Commit
6726bbc
1 Parent(s): 2260ff0

initial revision

Browse files
Files changed (4) hide show
  1. Dockerfile +21 -0
  2. README.md +1 -1
  3. metadata.json +8 -0
  4. requirements.txt +4 -0
Dockerfile ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM python:3.11
2
+
3
+ WORKDIR /code
4
+
5
+ COPY ./requirements.txt /code/requirements.txt
6
+
7
+ RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
8
+
9
+ # Download extinction risk predictions and prepare for use with datasette
10
+ RUN mkdir /data
11
+ ADD https://zenodo.org/records/10605228/files/Angiosperm_extinction_risk_predictions_v1.csv /data/Angiosperm_extinction_risk_predictions_v1.csv
12
+
13
+ RUN csvs-to-sqlite /data/Angiosperm_extinction_risk_predictions_v1.csv /code/extinctionrisk.db
14
+ RUN ls -l /code
15
+ RUN sqlite-utils tables /code/extinctionrisk.db --counts
16
+ RUN chmod 755 /code/extinctionrisk.db
17
+
18
+ # Create datasette metadata file
19
+ COPY ./metadata.json /code/metadata.json
20
+
21
+ CMD ["datasette", "/code/extinctionrisk.db", "-m", "/code/metadata.json", "--host", "0.0.0.0", "--port", "7860", "--setting", "sql_time_limit_ms", "3500"]
README.md CHANGED
@@ -1,7 +1,7 @@
1
  ---
2
  title: Extinction Risk
3
  emoji: 🏢
4
- colorFrom: indigo
5
  colorTo: blue
6
  sdk: docker
7
  pinned: false
 
1
  ---
2
  title: Extinction Risk
3
  emoji: 🏢
4
+ colorFrom: red
5
  colorTo: blue
6
  sdk: docker
7
  pinned: false
metadata.json ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "title": "Extinction risk predictions",
3
+ "description": "A datasette instance containing extinction risk predictions.",
4
+ "source": "https://spbachman.shinyapps.io/shiny_preds/",
5
+ "databases": {
6
+ "extinction-risk": {}
7
+ }
8
+ }
requirements.txt ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ datasette
2
+ sqlite-utils
3
+ csvs-to-sqlite
4
+ pandas==1.5.3