File size: 877 Bytes
6726bbc
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
a463f6e
 
 
6726bbc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
FROM python:3.11

WORKDIR /code

COPY ./requirements.txt /code/requirements.txt

RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt

# Download extinction risk predictions and prepare for use with datasette
RUN mkdir /data
ADD https://zenodo.org/records/10605228/files/Angiosperm_extinction_risk_predictions_v1.csv /data/Angiosperm_extinction_risk_predictions_v1.csv

RUN csvs-to-sqlite /data/Angiosperm_extinction_risk_predictions_v1.csv /code/extinctionrisk.db
RUN ls -l /code
RUN sqlite-utils tables /code/extinctionrisk.db --counts
RUN chmod 755 /code/extinctionrisk.db

# Create datasette metadata file
COPY ./metadata.json /code/metadata.json

# Add plot plugin
RUN datasette install datasette-plot

CMD ["datasette", "/code/extinctionrisk.db", "-m", "/code/metadata.json", "--host", "0.0.0.0", "--port", "7860", "--setting", "sql_time_limit_ms", "3500"]