-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathDockerfile
109 lines (69 loc) · 2.39 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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
FROM python:3.10-slim-buster as orderly_pip
RUN apt-get update
RUN apt-get install -y libpq-dev gcc make
RUN adduser --disabled-password worker
ENV PATH="/home/worker/.local/bin:${PATH}"
WORKDIR /home/worker/repo/
ADD pyproject.toml poetry.lock README.md /home/worker/repo/
RUN chown -R worker:worker /home/worker
USER worker
RUN python -m pip install -U pip
RUN python -m venv env
RUN . /home/worker/repo/env/bin/activate && python -m pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ orderly
ADD Makefile /home/worker/repo/
ADD tests/ /home/worker/repo/tests/
ENV PYTHONUNBUFFERED=1
RUN echo 'source env/bin/activate' >> /home/worker/.bashrc
ENTRYPOINT [ "/bin/bash", "-l"]
FROM python:3.10-slim-buster as orderly_base
RUN apt-get update
RUN apt-get install -y libpq-dev gcc make
RUN adduser --disabled-password worker
ENV PATH="/home/worker/.local/bin:${PATH}"
WORKDIR /home/worker/repo/
ADD pyproject.toml poetry.lock README.md /home/worker/repo/
RUN chown -R worker:worker /home/worker/repo
USER worker
RUN python -m pip install -U pip
RUN python -m pip install poetry
RUN python -m poetry install
RUN python -m poetry add psutil
ADD Makefile /home/worker/repo/
ADD orderly/ /home/worker/repo/orderly/
ADD tests/ /home/worker/repo/tests/
USER root
RUN chown -R worker:worker /home/worker/repo
ENV PYTHONUNBUFFERED=1
USER worker
CMD ["bash"]
FROM orderly_base as orderly_base_sudo
USER root
FROM orderly_base as orderly_test
CMD ["make", "pytest"]
FROM orderly_base as orderly_black
CMD ["make", "black"]
FROM orderly_base as orderly_mypy
CMD ["make", "mypy"]
FROM orderly_base as orderly_mypy_strict
CMD ["make", "strict_mypy"]
FROM orderly_base as orderly_gen_test_data
CMD ["make", "gen_test_data"]
FROM ubuntu:20.04 as orderly_download
RUN apt-get update && apt-get install -y make curl unzip
FROM orderly_download as orderly_download_linux
RUN adduser --disabled-password worker
USER worker
WORKDIR /app
ADD Makefile /app
CMD ["make", "_linux_get_ord"]
FROM orderly_download as orderly_download_root
WORKDIR /app
ADD Makefile /app
CMD ["make", "_root_get_ord"]
FROM continuumio/miniconda3 as rxnmapper_base
RUN conda create -n rxnmapper python=3.6 -y
SHELL ["conda", "run", "-n", "rxnmapper", "/bin/bash", "-c"]
RUN pip install rxnmapper
RUN pip install rdkit-pypi
RUN echo 'conda activate rxnmapper' >> /root/.bashrc
ENTRYPOINT [ "/bin/bash", "-l"]