Code Review
/
ccsdk
/
distribution.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
migrate ansible server python scripts to python3
[ccsdk/distribution.git]
/
ansible-server
/
src
/
main
/
Dockerfile
diff --git
a/ansible-server/src/main/Dockerfile
b/ansible-server/src/main/Dockerfile
index
0555e7d
..
5a1c394
100644
(file)
--- a/
ansible-server/src/main/Dockerfile
+++ b/
ansible-server/src/main/Dockerfile
@@
-7,21
+7,35
@@
WORKDIR /opt/
COPY ansible-server/requirements.txt ansible-server/requirements.txt
COPY ansible-server/requirements.txt ansible-server/requirements.txt
-RUN apk add --no-cache py2-pip \
- python2 &&\
+RUN apk add --no-cache curl \
+ iputils \
+ bash \
+ py3-pip \
+ openssh-client \
+ python3 &&\
apk add --no-cache --virtual .build-deps build-base \
libffi-dev \
openssl-dev \
apk add --no-cache --virtual .build-deps build-base \
libffi-dev \
openssl-dev \
- python
2
-dev &&\
- pip install --no-cache-dir --upgrade pip==$PIP_TAG && \
- pip install --no-cache-dir -r ansible-server/requirements.txt &&\
+ python
3
-dev &&\
+ pip
3
install --no-cache-dir --upgrade pip==$PIP_TAG && \
+ pip
3
install --no-cache-dir -r ansible-server/requirements.txt &&\
apk del .build-deps
apk del .build-deps
-COPY ansible-server ansible-server
-COPY configuration/ansible.cfg /etc/ansible/ansible.cfg
+RUN addgroup -S ansible && adduser -S ansible -G ansible
+
+COPY --chown=ansible:ansible ansible-server ansible-server
+COPY --chown=ansible:ansible configuration/ansible.cfg /etc/ansible/ansible.cfg
WORKDIR /opt/ansible-server
WORKDIR /opt/ansible-server
+RUN mkdir /opt/onap ; ln -s /opt/ansible-server /opt/onap/ccsdk
+RUN echo > /var/log/ansible-server.log
+RUN chown -R ansible:ansible /var/log
+RUN chown ansible:ansible /opt/ansible-server
+
+USER ansible:ansible
+
+
EXPOSE 8000
EXPOSE 8000
-ENTRYPOINT ["python2", "RestServer.py"]
+
##
ENTRYPOINT ["python2", "RestServer.py"]