Skip to content

Commit

Permalink
Fix files being left over in cache
Browse files Browse the repository at this point in the history
  • Loading branch information
oliverguenther committed May 8, 2024
1 parent 74de1af commit 67e7826
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
5 changes: 0 additions & 5 deletions docker/prod/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,6 @@ RUN cp Gemfile.lock.bak Gemfile.lock && rm Gemfile.lock.bak
RUN ./docker/prod/setup/precompile-assets.sh
RUN ./docker/prod/setup/postinstall-common.sh

# 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

RUN cp ./config/database.production.yml config/database.yml
RUN ln -s $APP_PATH/docker/prod/setup/.irbrc /home/$APP_USER/

Expand Down
13 changes: 12 additions & 1 deletion docker/prod/setup/postinstall-common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,15 @@ set -eox pipefail
mkdir -p /tmp/op_uploaded_files/ && chown -R $APP_USER:$APP_USER /tmp/op_uploaded_files/

# Remove any existing config/database.yml
rm -f ./config/database.yml
rm -f ./config/database.yml

# 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).
tmp_path="$APP_PATH/tmp"
# Remove any previously cached files from e.g., asset building
rm -rf "$tmp_path"
# Recreate and own it for the user for later files (PID etc. see above)
mkdir -p "$tmp_path"
chown -R $APP_USER:$APP_USER "$tmp_path"
chmod g+rw "$tmp_path"

0 comments on commit 67e7826

Please sign in to comment.