diff --git a/Dockerfile b/Dockerfile index 0ffd261..a792552 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,21 +1,21 @@ # Fully qualified container name prevents public registry typosquatting -FROM docker.io/library/python:3-slim +FROM docker.io/library/python:3-alpine ARG UID=1012 ARG GID=1012 -RUN addgroup --system --gid $GID vuegraf -RUN adduser --system --gid $GID --uid $UID --home /opt/vuegraf vuegraf +RUN addgroup -S -g $GID vuegraf +RUN adduser -S -g $GID -u $UID -h /opt/vuegraf vuegraf WORKDIR /opt/vuegraf # Install pip dependencies with minimal container layer size growth COPY src/requirements.txt ./ RUN set -x && \ - apt update -y && \ - apt upgrade -y && \ + apk add --no-cache build-base libffi-dev rust cargo openssl-dev && \ pip install --upgrade pip && \ pip install --no-cache-dir -r requirements.txt && \ + apk del build-base libffi-dev rust cargo openssl-dev && \ rm -rf /var/cache/apk /opt/vuegraf/requirements.txt # Copying code in after requirements are built optimizes rebuild