-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
69 lines (47 loc) · 1.5 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
FROM continuumio/miniconda3 as base
LABEL maintainer="REX Engineering <engineering@rexchange.com>"
# Create the directory containing the code.
RUN mkdir -p /code
WORKDIR /code
RUN apt-get update && \
apt-get -y install gcc mono-mcs curl && \
rm -rf /var/lib/apt/lists/*
FROM base as req
COPY environment.yml /code/
RUN conda install anaconda-client
ARG REX_ANACONDA_MACHINE_USER_USERNAME
ARG REX_ANACONDA_MACHINE_USER_PASSWORD
RUN yes | anaconda login --username $REX_ANACONDA_MACHINE_USER_USERNAME --password $REX_ANACONDA_MACHINE_USER_PASSWORD && \
conda update setuptools && \
conda update -n base conda --yes && \
conda env create && \
conda clean --all --yes
FROM req as build
# Copy the code files.
COPY rexflow_ui /code/rexflow_ui
COPY prism_api /code/prism_api
COPY setup.py /code/setup.py
COPY scripts /code/scripts
FROM build as lint
SHELL ["/bin/bash", "-c"]
RUN source activate prism-api && flake8
FROM build as test
COPY pytest.ini /code/pytest.ini
SHELL ["/bin/bash", "-c"]
RUN source activate prism-api && pytest -m 'ci' --cov prism_api
FROM req as debugger
SHELL ["/bin/bash", "-c"]
RUN source activate prism-api && pip install debugpy -t /tmp --upgrade
FROM build as debug
COPY --from=debugger /tmp/debugpy /tmp/debugpy
EXPOSE 8000
EXPOSE 5678
CMD ["./scripts/run_prism.debug.sh"]
FROM build as rexflow_mock
COPY rexflow_mock /code/rexflow_mock
EXPOSE 8001
CMD ["./scripts/run_rexflow_mock.sh"]
FROM build as container
# Run the app
EXPOSE 8000
CMD ["./scripts/run_prism.sh"]