-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
65 lines (49 loc) · 1.55 KB
/
Dockerfile
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# Install Prefect from their image
FROM prefecthq/prefect:2.10.4-python3.9 as build1
COPY docker-requirements.txt .
# Install python dependencies
RUN pip install -r docker-requirements.txt \
--trusted-host pypi.python.org \
--no-cache-dir
COPY bin /opt/prefect/flows/bin
# Make all scripts executable
RUN chmod +x /opt/prefect/flows/bin/*.py && \
chmod +x /opt/prefect/flows/bin/*.sh
RUN mkdir -p /opt/prefect/data
# Use ubuntu:focal as main image to build edirect
FROM ubuntu:focal as build2
LABEL base.image="ubuntu:focal"
LABEL dockerfile.version="1.0.0"
LABEL description="Prefect and NCBI's edirect tool."
LABEL maintainer="Gregory Sprenger"
# Install dependencies for edirect
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive \
apt-get install -y \
libtime-hires-perl \
curl \
wget \
tzdata \
parallel
# Install edirect
RUN sh -c "$(curl -fsSL https://ftp.ncbi.nlm.nih.gov/entrez/entrezdirect/install-edirect.sh)"
# Final docker image
FROM ubuntu:focal as app
COPY --from=build1 /usr/ /usr/
COPY --from=build1 /opt/prefect/ /opt/prefect/
COPY --from=build2 /usr/ /usr/
COPY --from=build2 /root/edirect/ /root/edirect/
ENV PATH="${PATH}:/root/edirect"
ENV PATH="${PATH}:/opt/prefect/flows/bin"
ENV PATH="${PATH}:/opt/prefect/flows/credentials"
ENV LC_ALL C.UTF-8
ENV LANG C.UTF-8
ENV TZ UTC
RUN mkdir /data
WORKDIR /data
# ENTRYPOINT ["main_flow.py"]
# Test versions of dependencies
FROM app as test
RUN apt-get update && apt-get install -y python3
COPY docker_tests/ ../tests
RUN python3 -m unittest discover -v -s ../tests