diff options
author | Michal Jagiello <michal.jagiello@t-mobile.pl> | 2020-07-17 13:06:11 +0000 |
---|---|---|
committer | Michal Jagiello <michal.jagiello@t-mobile.pl> | 2020-07-22 13:57:55 +0000 |
commit | df9877a76ce131f9ed1cc1f187847bc5ef5cf814 (patch) | |
tree | cc2dc6f595f2be0ed5f59943266653df2ad0f1f1 /Dockerfile | |
parent | 2776802ae1fe4f1fbcd8c99e53bb07295ab97228 (diff) |
Run in Python 3.82.5.3
Use image recommended by SECCOM
Issue-ID: DCAEGEN2-2292
Signed-off-by: Michal Jagiello <michal.jagiello@t-mobile.pl>
Change-Id: I52a358f22c5f9c2e1cad4b574105c8bda10acf25
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 |