Skip to content
11 changes: 7 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,15 @@ USER "$USERNAME"
WORKDIR "$APP_HOME"

# Copy everything from the builder image
COPY --link --chown="$USERNAME:$USERNAME" --chmod=700 . .
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@axelpontetto please review this PR, Heroku started failing since we merged these changes and I got copilot to fix it

COPY --from=builder --chown="$USERNAME:$USERNAME" --chmod=700 "$APP_HOME/public/" "$APP_HOME/public/"
COPY --from=builder --chown="$USERNAME:$USERNAME" --chmod=700 "$APP_HOME/tmp/" "$APP_HOME/tmp/"
COPY --from=builder --chown="$USERNAME:$USERNAME" --chmod=700 "$APP_HOME/vendor/" "$APP_HOME/vendor/"
COPY --chown="$USERNAME:$USERNAME" . .
COPY --from=builder --chown="$USERNAME:$USERNAME" "$APP_HOME/public/" "$APP_HOME/public/"
COPY --from=builder --chown="$USERNAME:$USERNAME" "$APP_HOME/tmp/" "$APP_HOME/tmp/"
COPY --from=builder --chown="$USERNAME:$USERNAME" "$APP_HOME/vendor/" "$APP_HOME/vendor/"

# Set permissions (700 for security) and create symlink
# Note: Permissions set via RUN instead of COPY --chmod for Heroku compatibility
USER root
RUN chmod -R 700 "$APP_HOME"
RUN ln -s /usr/lib/*-linux-gnu/libjemalloc.so.2 /usr/lib/libjemalloc.so.2
USER "$USERNAME"

Expand Down