Nicky Nicolson commited on
Commit
7a26d32
·
1 Parent(s): 80bafd5

Extract GBIF download ID to variable

Browse files
Files changed (1) hide show
  1. Dockerfile +3 -2
Dockerfile CHANGED
@@ -1,5 +1,6 @@
1
  FROM python:3.11
2
 
 
3
 
4
  WORKDIR /code
5
 
@@ -11,12 +12,12 @@ ADD https://docs.google.com/uc?export=download&id=17mI5W0qiGiBp_RV1jy3QR3KtN7Ah-
11
 
12
  # Download GBIF occurrences and prepare for use with datasette
13
  RUN mkdir /data
14
- ADD https://api.gbif.org/v1/occurrence/download/request/0032228-231002084531237.zip /data/gbif-occs.zip
15
  RUN ls -l /data
16
  RUN unzip /data/gbif-occs.zip -d /data
17
  RUN ls -l /data
18
  COPY ./tab2csv.py /code/tab2csv.py
19
- RUN python tab2csv.py /data/0032228-231002084531237.csv /data/gbifocc.csv
20
  RUN csvs-to-sqlite /data/gbifocc.csv /code/gbifocc.db
21
  RUN ls -l /code
22
  RUN sqlite-utils tables /code/gbifocc.db --counts
 
1
  FROM python:3.11
2
 
3
+ ARG GBIF_DOWNLOAD_ID="0032228-231002084531237"
4
 
5
  WORKDIR /code
6
 
 
12
 
13
  # Download GBIF occurrences and prepare for use with datasette
14
  RUN mkdir /data
15
+ ADD https://api.gbif.org/v1/occurrence/download/request/${GBIF_DOWNLOAD_ID}.zip /data/gbif-occs.zip
16
  RUN ls -l /data
17
  RUN unzip /data/gbif-occs.zip -d /data
18
  RUN ls -l /data
19
  COPY ./tab2csv.py /code/tab2csv.py
20
+ RUN python tab2csv.py /data/${GBIF_DOWNLOAD_ID}.csv /data/gbifocc.csv
21
  RUN csvs-to-sqlite /data/gbifocc.csv /code/gbifocc.db
22
  RUN ls -l /code
23
  RUN sqlite-utils tables /code/gbifocc.db --counts