aboutsummaryrefslogtreecommitdiffstats
path: root/Dockerfile
blob: db32b241ac1f4bf65f5ef4cbe812f1342385a296 (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
FROM python:3.8.2-alpine3.11
MAINTAINER tommy@research.att.com

EXPOSE 10000

# it is an ONAP requirement to make, and switch to, a non root user
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

COPY . /app

# 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 libffi-dev && \ 
    pip install --upgrade pip && \
    pip install .

# turn on file based EELF logging
ENV PROD_LOGGING 1

# Run the application
USER $user
CMD run.py