Cleaning up Dockerfiles
[ccsdk/distribution.git] / ansible-server / src / main / Dockerfile
1 FROM onap/integration-python:8.0.0
2 LABEL maintainer="SDN-C Team (sdnc@lists.openecomp.org)"
3 USER root
4
5 ENV http_proxy ${http_proxy}
6 ENV https_proxy ${https_proxy}
7 ENV PIP_EXTRA_OPTS ${https_proxy:+"--trusted-host pypi.org --trusted-host files.pythonhosted.org --proxy=${https_proxy}"}
8 ENV PIP_EXTRA_OPTS ${PIP_EXTRA_OPTS:-""}
9
10 ARG PIP_TAG=18.0
11
12 RUN addgroup -S ansible && adduser -S ansible -G ansible
13 COPY --chown=ansible:ansible ansible-server /opt/ansible-server
14 COPY --chown=ansible:ansible configuration/ansible.cfg /etc/ansible/ansible.cfg
15
16 RUN apk add --no-cache curl iputils bash openssh-client \
17     && curl https://sh.rustup.rs -sSf | sh -s -- -y \
18     && source $HOME/.cargo/env \
19     && apk add --no-cache --virtual .build-deps build-base libffi-dev openssl-dev python3-dev \
20     && pip3 install --no-cache-dir --upgrade pip ${PIP_EXTRA_OPTS} \
21     && pip3 install --no-cache-dir -r /opt/ansible-server/requirements.txt ${PIP_EXTRA_OPTS} \
22     && apk del .build-deps \
23     && mkdir -p /opt/onap \
24     && touch /var/log/ansible-server.log \
25     && chown -R ansible:ansible /var/log
26
27 USER ansible:ansible
28 EXPOSE 8000
29 WORKDIR /opt/ansible-server
30 ##ENTRYPOINT ["python2", "RestServer.py"]