FROM python:3.11 # Download ID is set as a space variable # By default it is a download of all Solanum preserved specimen records (c600K) ARG GBIF_DATASET_ID=$GBIF_DATASET_ID WORKDIR /code COPY ./requirements.txt /code/requirements.txt RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt # Download GBIF occurrences and prepare for use with datasette RUN mkdir /data ADD https://api.gbif.org/v1/literature/export?format=TSV&gbifDatasetKey=${GBIF_DATASET_ID} /data/gbif-citations.tsv COPY ./tab2csv.py /code/tab2csv.py RUN python tab2csv.py --createcols /data/gbif-citations.tsv /data/gbif-citations.csv RUN csvs-to-sqlite /data/gbif-citations.csv /code/gbifcit.db RUN ls -l /code RUN sqlite-utils tables /code/gbifcit.db --counts RUN chmod 755 /code/gbifcit.db COPY ./metadata.json /code/metadata.json COPY ./getDownloadMetadata.py /code/getDownloadMetadata.py RUN python getDownloadMetadata.py --dataset_id=${GBIF_DATASET_ID} /code/metadata.json /code/metadata.json CMD ["datasette", "/code/gbifcit.db", "-m", "/code/metadata.json", "--host", "0.0.0.0", "--port", "7860"]