about summary refs log tree commit diff
path: root/Dockerfile
diff options
context:
space:
mode:
authorDavid Yip <yipdw@member.fsf.org>2018-02-23 15:05:00 -0600
committerGitHub <noreply@github.com>2018-02-23 15:05:00 -0600
commitf53953d28a24fe65f1ca66d85a1416ba30dcda86 (patch)
tree4e9e2214629b46ddc98fdce358abc812112f13fa /Dockerfile
parent544543e40a723d9719f5571bd4c3455a6a69fccd (diff)
parentf2f19e1f8a3a048cf0a0041ae54d912acfea7742 (diff)
Merge pull request #369 from KnzkDev/merge-upstream
Merge with upstream @ e668180044560e28bdc5eef94744c210013efcda
Diffstat (limited to 'Dockerfile')
-rw-r--r--Dockerfile16
1 files changed, 9 insertions, 7 deletions
diff --git a/Dockerfile b/Dockerfile
index 6d8465ddc..a50122057 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -3,8 +3,10 @@ FROM ruby:2.5.0-alpine3.7
 LABEL maintainer="https://github.com/tootsuite/mastodon" \
       description="A GNU Social-compatible microblogging server"
 
-ENV UID=991 GID=991 \
-    RAILS_SERVE_STATIC_FILES=true \
+ARG UID=991
+ARG GID=991
+
+ENV RAILS_SERVE_STATIC_FILES=true \
     RAILS_ENV=production NODE_ENV=production
 
 ARG YARN_VERSION=1.3.2
@@ -71,12 +73,12 @@ RUN bundle config build.nokogiri --with-iconv-lib=/usr/local/lib --with-iconv-in
  && yarn --pure-lockfile \
  && yarn cache clean
 
-COPY . /mastodon
-
-COPY docker_entrypoint.sh /usr/local/bin/run
+RUN addgroup -g ${GID} mastodon && adduser -h /mastodon -s /bin/sh -D -G mastodon -u ${UID} mastodon
 
-RUN chmod +x /usr/local/bin/run
+COPY --chown=mastodon:mastodon . /mastodon
 
 VOLUME /mastodon/public/system /mastodon/public/assets /mastodon/public/packs
 
-ENTRYPOINT ["/usr/local/bin/run"]
+USER mastodon
+
+ENTRYPOINT ["/sbin/tini", "--"]