about summary refs log tree commit diff
path: root/Dockerfile
diff options
context:
space:
mode:
Diffstat (limited to 'Dockerfile')
-rw-r--r--Dockerfile12
1 files changed, 8 insertions, 4 deletions
diff --git a/Dockerfile b/Dockerfile
index d7490adfc..c5225f7bb 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -112,11 +112,15 @@ ENV NODE_ENV="production"
 ENV RAILS_SERVE_STATIC_FILES="true"
 ENV BIND="0.0.0.0"
 
+USER mastodon
+
 # Precompile assets
-RUN su - mastodon -c "cd ~ && \
-	OTP_SECRET=_ SECRET_KEY_BASE=_ rails assets:precompile && \
-	yarn cache clean" && \
-	rm -rf /opt/mastodon/tmp/*
+RUN OTP_SECRET=_ SECRET_KEY_BASE=_ rails assets:precompile && yarn cache clean
+
+# Empty temporary files
+USER root
+
+RUN rm -rf /opt/mastodon/tmp/*
 
 # Set the run user
 USER mastodon