diff options
author | Vijay Venkatesh Kumar <vv770d@att.com> | 2020-07-23 17:20:20 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2020-07-23 17:20:20 +0000 |
commit | eb67917b237c03d5c1f3c2598aa47f3440decd4a (patch) | |
tree | 00efdc4af04e5bd32cc7eb8a510a6f35732d3035 /Dockerfile | |
parent | fb84d6d2d2c577f95ece1340a0f01acbe9f40a7f (diff) | |
parent | df9877a76ce131f9ed1cc1f187847bc5ef5cf814 (diff) |
Merge "Run in Python 3.8"
Diffstat (limited to 'Dockerfile')
-rw-r--r-- | Dockerfile | 25 |
1 files changed, 14 insertions, 11 deletions
@@ -1,20 +1,23 @@ -FROM python:3.7-alpine +FROM python:3.8.2-alpine3.11 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 +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 -# 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 && \ +RUN apk add build-base libffi-dev && \ pip install --upgrade pip && \ pip install . @@ -22,5 +25,5 @@ RUN apk add build-base && \ ENV PROD_LOGGING 1 # Run the application -USER $CBSUSER +USER $user CMD run.py |