about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--Dockerfile12
1 files changed, 6 insertions, 6 deletions
diff --git a/Dockerfile b/Dockerfile
index db9faaba0..d7490adfc 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -112,15 +112,15 @@ ENV NODE_ENV="production"
 ENV RAILS_SERVE_STATIC_FILES="true"
 ENV BIND="0.0.0.0"
 
-# Set the run user
-USER mastodon
-
 # Precompile assets
-RUN cd ~ && \
+RUN su - mastodon -c "cd ~ && \
 	OTP_SECRET=_ SECRET_KEY_BASE=_ rails assets:precompile && \
-	yarn cache clean && \
+	yarn cache clean" && \
 	rm -rf /opt/mastodon/tmp/*
 
+# Set the run user
+USER mastodon
+
 # Set the work dir and the container entry point
 WORKDIR /opt/mastodon
-ENTRYPOINT ["/tini", "--"]
+ENTRYPOINT ["/tini", "--"]
\ No newline at end of file