Update images to run as non-root
[dcaegen2/platform.git] / mod / distributorapi / Dockerfile
index cc10c68..f82607d 100644 (file)
 # ============LICENSE_END=========================================================
 FROM python:3.7-alpine
 
+ARG UID=1000
+ARG GID=1000
 COPY . /code
 WORKDIR /code
-RUN pip install .
-EXPOSE 80
+RUN pip install . && \
+    addgroup -g $GID dcaemod && \
+    adduser -s /bin/bash -u $UID -G dcaemod -D dcaemod
+USER dcaemod
+EXPOSE 8080
 ENV DISTRIBUTOR_DEBUG=0
 CMD start-distributor-api