Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

allow writing with correct suppl. group

Markus Kahlcb5ac93714cb
diff --git a/docker/prod/Dockerfile b/docker/prod/Dockerfile
index b2f057ca67c..d788173d4af 100644
--- a/docker/prod/Dockerfile
+++ b/docker/prod/Dockerfile
@@ -92,7 +92,7 @@ ENV OPENPROJECT_RAILS__CACHE__STORE=file_store
RUN useradd -d /home/$APP_USER -m $APP_USER
RUN mkdir -p $APP_PATH && chown $APP_USER:$APP_USER $APP_PATH
-RUN mkdir -p $APP_DATA_PATH && chown $APP_USER:$APP_USER $APP_DATA_PATH
+RUN mkdir -p $APP_DATA_PATH && chown $APP_USER:$APP_USER $APP_DATA_PATH && chmod g+rwx $APP_DATA_PATH
WORKDIR $APP_PATH
@@ -123,6 +123,11 @@ COPY --chown=$APP_USER:$APP_USER --from=assets /app/public/assets /app/public/as
COPY --chown=$APP_USER:$APP_USER --from=assets /app/config/frontend_assets.manifest.json /app/config/frontend_assets.manifest.json
COPY --chown=$APP_USER:$APP_USER . .
+# We need this so puma is allowed to create the tmp/pids folder and
+# temporary upload files when running with a uid other than 1000 (app)
+# but with an allowed supplemental group (1000).
+RUN tmp_path=$APP_PATH/tmp; (mkdir -p $tmp_path || true) && chown $APP_USER:$APP_USER $tmp_path && chmod g+rw $tmp_path
+
USER $APP_USER
RUN ln -s $APP_PATH/docker/prod/setup/.irbrc /home/$APP_USER/
@@ -187,10 +192,6 @@ RUN cp Gemfile.lock.bak Gemfile.lock && rm Gemfile.lock.bak
RUN ./docker/prod/setup/postinstall.sh
-# We need this so puma is allowed to create the tmp/pids folder and files
-# even when the container is run as a user other than 1000 (app)
-RUN tmp_path=$APP_PATH/tmp; (mkdir -p $tmp_path || true) && chmod og+rw $tmp_path
-
# Expose ports for apache and postgres
EXPOSE 80 5432