Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set Docker permissions during the build process #6514

Merged
merged 3 commits into from
Feb 20, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
16 changes: 9 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -68,12 +70,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=${UID}:${GID} . /mastodon

VOLUME /mastodon/public/system /mastodon/public/assets /mastodon/public/packs

ENTRYPOINT ["/usr/local/bin/run"]
USER mastodon

ENTRYPOINT ["/sbin/tini", "--"]
14 changes: 0 additions & 14 deletions docker_entrypoint.sh

This file was deleted.