-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathDockerfile.rhel7
36 lines (28 loc) · 993 Bytes
/
Dockerfile.rhel7
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
FROM rhscl/s2i-core-rhel7
ENV PYTHON_VERSION=3.6 \
PATH=$HOME/.local/bin/:$PATH \
PYTHONUNBUFFERED=1 \
PYTHONIOENCODING=UTF-8 \
LC_ALL=en_US.UTF-8 \
LANG=en_US.UTF-8 \
PIP_NO_CACHE_DIR=off \
RPM=$RPM
WORKDIR /home/user
COPY Pipfile /home/user/
COPY $RPM /home/user/
COPY tf_model.py /home/user/
RUN yum install -y $RPM
RUN yum install -y rh-python36 rh-python36-python-devel rh-python36-python-setuptools rh-python36-python-pip \
&& yum install -y yum-utils \
&& prepare-yum-repositories rhel-server-rhscl-7-rpms \
&& yum -y clean all --enablerepo='*'
RUN source scl_source enable rh-python36 && \
virtualenv ${APP_ROOT} && \
chown -R 1001:0 ${APP_ROOT}
RUN echo "python="`python --version`
RUN pip3.6 --version
RUN pip3.6 install pipenv \
&& pipenv install --python 3.6 \
&& pipenv run python tf_model.py
# tensorflow model would be served via container port 80
CMD ["tensorflow_model_server","--model_base_path=/home/user/","--port=80"]