aboutsummaryrefslogtreecommitdiffstats
path: root/Dockerfile
blob: df26a5937c1c80f70163e7a438a2f15129e34f20 (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
FROM python:3.7-alpine
MAINTAINER tommy@research.att.com

COPY . /tmp
WORKDIR /tmp

EXPOSE 10000

# it is an ONAP requirement to make, and switch to, a non root user
ENV CBSUSER cbs
RUN addgroup -S $CBSUSER && adduser -S -G $CBSUSER $CBSUSER 

# create logs dir and install
# alpine does not come with GCC like the standard "python" docker base does, which the install needs, see https://wiki.alpinelinux.org/wiki/GCC
RUN apk add build-base && \ 
    mkdir -p /opt/logs/ && \
    chown $CBSUSER:$CBSUSER /opt/logs && \
    pip install --upgrade pip && \
    pip install .

# turn on file based EELF logging
ENV PROD_LOGGING 1

# Run the application
USER $CBSUSER
CMD run.py