docker: alpine -> debian:bullseye

docker: alpine → debian:bullseye

CDCK have elected to standardise on Debian base images.

Bumps ruby from 2.6 to 2.7.

diff --git a/Dockerfile b/Dockerfile
index 8215acd..af6b2b0 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,34 +1,51 @@
-FROM ruby:2.6-alpine
+FROM debian:bullseye-slim
 
 MAINTAINER Matt Palmer "matt.palmer@discourse.org"
 
-COPY Gemfile Gemfile.lock /home/ddnssd/
-
-RUN adduser -D ddnssd \
-	&& delgroup ping \
-	&& docker_group="$(getent group 999 | cut -d : -f 1)" \
-	&& if [ -z "$docker_group" ]; then addgroup -g 999 docker; docker_group=docker; fi \
-	&& addgroup ddnssd "$docker_group" \
-	&& apk update \
-	&& apk add build-base \
-	&& apk add postgresql-dev \
-	&& cd /home/ddnssd \
-	&& su -pc 'gem install bundler:2.1.2' ddnssd \
-	&& su -pc 'bundle config set without development' ddnssd \
-	&& su -pc 'bundle config set deployment true' ddnssd \
-	&& su -pc 'bundle install' ddnssd \
-	&& apk del build-base \
-	&& rm -rf /tmp/* /var/cache/apk/*
+WORKDIR /tmp
+
+COPY Gemfile Gemfile.lock ./
+
+# UID/GID assignments align with an older Alpine-based implementation.
+# People outside CDCK may rely on them...  for some reason.
+
+RUN groupadd -g 999 docker \
+  && groupadd -g 1000 ddnssd \
+  && useradd -u 1000 -g ddnssd -G docker -N ddnssd \
+  && DEBIAN_FRONTEND=noninteractive apt-get update \
+  && DEBIAN_FRONTEND=noninteractive apt-get -y dist-upgrade \
+  && DEBIAN_FRONTEND=noninteractive apt-get -y install --no-install-recommends \
+    build-essential \
+    bundler \
+    libffi-dev \
+    libffi7 \
+    libpq-dev \
+    libpq5 \
+    ruby \
+    ruby-dev \
+  && bundle install \
+  && rm -rf /root/.bundle/cache \
+  && DEBIAN_FRONTEND=noninteractive apt-get -y remove \
+    build-essential \
+    bundler \
+    libffi-dev \
+    libpq-dev \
+    ruby-dev \
+  && DEBIAN_FRONTEND=noninteractive apt-get -y autoremove \
+  && DEBIAN_FRONTEND=noninteractive apt-get clean \
+  && ( find /var/lib/apt/lists -mindepth 1 -maxdepth 1 -delete || true ) \
+  && ( find /var/tmp -mindepth 1 -maxdepth 1 -delete || true ) \
+  && ( find /tmp -mindepth 1 -maxdepth 1 -delete || true )
 
 ARG GIT_REVISION=invalid-build
 ENV DDNSSD_GIT_REVISION=$GIT_REVISION DDNSSD_DISABLE_LOG_TIMESTAMPS=yes
 
 COPY bin/* /usr/local/bin/
-COPY lib/ /usr/local/lib/ruby/2.6.0/
+COPY lib/ /usr/local/lib/site_ruby/2.7.0/
 
 EXPOSE 9218
 LABEL org.discourse.service._prom-exp.port=9218 org.discourse.service._prom-exp.instance=ddns-sd
 
 USER ddnssd
 WORKDIR /home/ddnssd
-ENTRYPOINT ["/usr/local/bin/bundle", "exec", "/usr/local/bin/ddns-sd"]
+ENTRYPOINT ["/usr/local/bin/ddns-sd"]

GitHub sha: 9f1c976a1fb515cb50e8c277d3571f7902e58619

This commit appears in #21 which was merged by saj.