-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
48 lines (36 loc) · 1.03 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
FROM python:3.8-slim as base
# define shell
SHELL ["/bin/bash", "-c", "-l"]
# switch to root in order to install dependencies
USER root
ENV DEBIAN_FRONTEND noninteractive
# retrieve build args
ARG GITLAB_ACCESS_TOKEN
ARG WRAPPER_DEPS_INSTALL
ARG WRAPPER_DEPS_EXTRA
# install linux-dependencies
RUN apt update
RUN apt install -y git
# add code base
WORKDIR /home/reaxpro/reaxpro_wrappers
COPY osp osp
COPY tests tests
COPY examples examples
COPY setup.* README.md ./
RUN chmod -R 0777 .
# # install wrappers and their python-dependencies
RUN pip install --upgrade pip
RUN pip install osp-core $WRAPPER_DEPS_INSTALL
RUN pip install .[develop] $WRAPPER_DEPS_EXTRA
################################## target: dev ##################################
from base as dev
# run pytests
RUN pytest tests/test_energy_landscape_refinement.py
# go /app dir
WORKDIR /app
USER root
################################## target: production ##################################
from base as production
# add reaxpro user
RUN useradd -ms /bin/bash reaxpro
USER reaxpro