Spaces:
Sleeping
Sleeping
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"] | |