]> cat aescling's git repositories - mastodon.git/commitdiff
Fix permissions for volumes (#6637)
authorhaosbvnker <github@chaosbunker.com>
Mon, 5 Mar 2018 15:45:09 +0000 (16:45 +0100)
committerEugen Rochko <eugen@zeonfederated.com>
Mon, 5 Mar 2018 15:45:09 +0000 (16:45 +0100)
When volumes are declared, but the corresponding directories don't exist, permissions for those directories will be root:root instead of mastodon:mastodon..
This changes makes sure the permissions of the volume directories are as expected.

Dockerfile

index dab4e87a64cc716be26cb04f3d1d7a53ad869cd7..c22756d0c75b4e45c4db87676649602ce7c43487 100644 (file)
@@ -70,7 +70,9 @@ RUN bundle config build.nokogiri --with-iconv-lib=/usr/local/lib --with-iconv-in
  && yarn --pure-lockfile \
  && yarn cache clean
 
-RUN addgroup -g ${GID} mastodon && adduser -h /mastodon -s /bin/sh -D -G mastodon -u ${UID} mastodon
+RUN addgroup -g ${GID} mastodon && adduser -h /mastodon -s /bin/sh -D -G mastodon -u ${UID} mastodon \
+ && mkdir -p /mastodon/public/system /mastodon/public/assets /mastodon/public/packs \
+ && chown -R mastodon:mastodon /mastodon/public
 
 COPY --chown=mastodon:mastodon . /mastodon