summaryrefslogtreecommitdiffstats
path: root/Dockerfile
blob: fee54d10e64780b1ae87f48209029408d61c75a4 (plain)
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
FROM python:3.8.2-alpine3.11
MAINTAINER gs244f@att.com

ARG user=onap
ARG group=onap

RUN addgroup -S $group && adduser -S -D -h /home/$user $user $group && \
    chown -R $user:$group /home/$user &&  \
    mkdir /var/log/$user && \
    chown -R $user:$group /var/log/$user && \
    mkdir /app && \
    chown -R $user:$group /app
	
WORKDIR /app

#ADD . /tmp
#RUN mkdir /tmp/config

EXPOSE 10002

COPY ./miss_htbt_service/ ./bin/
COPY ./etc/ ./etc/
COPY requirements.txt ./
COPY setup.py ./

#need pip > 8 to have internal pypi repo in requirements.txt
#do the install
RUN apk add build-base libffi-dev postgresql-dev && \
    pip install --upgrade pip && \
    pip install pyyaml --upgrade && \
    pip install -r requirements.txt && \
    pip install -e .

RUN mkdir -p data \
 && mkdir -p logs \
 && mkdir -p tmp \
 && chown -R $user:$group . \
 && chmod a+w data \
 && chmod a+w logs \
 && chmod a+w tmp \
 && chmod a+w etc \
 && chmod 500 bin/*.py \
 && chmod 500 bin/*.sh \
 && chmod 500 bin/*/*.py

USER $user
VOLUME logs

CMD ["./bin/misshtbt.sh"]

#ENV PYTHONPATH="/usr/local/lib/python3.6:/usr/local/lib/python3.6/site-packages:${PATH}"
#ENV PYTHONPATH="/usr/local/lib/python3.6/site-packages:/usr/local/lib/python3.6"
#ENV PYTHONPATH=/usr/local/lib/python3.6/site-packages:.
#ENTRYPOINT ["/bin/python", "./bin/run.py"]
#ENTRYPOINT ["/usr/bin/python","./bin/run.py" ]
#ENTRYPOINT ["/usr/local/bin/python","./bin/misshtbtd.py" ]
#ENTRYPOINT ["/bin/ls","-lR", "."]