Rewritten code to Python 3
- Docker baseimage change to alpine
- bumped all deps
- skip testing till py36 is available in CI
Change-Id: I7b0ca2b28e2c639645ea07e2b3adb21b857b2fe5
Related-PROD: PRODX-11711
Related-PROD: PRODX-14584
diff --git a/Dockerfile b/Dockerfile
index 377a7f7..20c8f13 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,33 +1,23 @@
-FROM ubuntu:xenial
+FROM python:3.9.1-alpine3.13
WORKDIR /app
-
-# explicitly set user/group IDs
-RUN groupadd -r -g 999 sfnotifier \
- && useradd -r -g sfnotifier -u 999 -m -s /sbin/nologin -d /app -c "sf-notifier user" sfnotifier
-
-# Install runtime requirements
-RUN export DEBIAN_FRONTEND=noninteractive \
- && apt-get update -qq \
- && apt-get upgrade -y \
- && apt-get install --no-install-recommends -y -q \
- curl \
- python2.7 \
- python-pip \
- python-wheel \
- python-setuptools \
- && apt-get clean \
- && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
+ENV CRYPTOGRAPHY_DONT_BUILD_RUST=1
COPY requirements.txt ./
-RUN buildDeps="build-essential git python2.7-dev" \
- && export DEBIAN_FRONTEND=noninteractive \
- && apt-get update -qq \
- && apt-get install --no-install-recommends -y -q ${buildDeps} \
- && CRYPTOGRAPHY_DONT_BUILD_RUST=1 pip install --no-cache-dir -r /app/requirements.txt \
- && apt-get purge -y ${buildDeps} \
- && apt-get clean \
- && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
-
+RUN addgroup --gid 1000 \
+ sfnotifier && \
+ adduser --ingroup sfnotifier \
+ --uid 1000 \
+ --disabled-password \
+ --home /app \
+ sfnotifier && \
+ apk upgrade --update --no-cache && \
+ apk add --no-cache \
+ build-base \
+ openssl-dev \
+ libffi-dev && \
+ pip install --upgrade pip && \
+ pip install -r /app/requirements.txt && \
+ apk del build-base
COPY . .
CMD ./entrypoint.sh