Open
Conversation
|
| ℹ️ Name | 🔗 Infos & links |
|---|---|
| 🌱 Deploying commit | f2d918c |
| 👁️ Preview | Generating preview app... |
Contributor
There was a problem hiding this comment.
Pull request overview
Updates Clever Cloud’s Ruby documentation to clarify how static files/assets should be handled, distinguishing standard Rails (asset pipeline) behaviour from cases where NGINX should serve static content directly.
Changes:
- Clarifies that typical Rails apps using the asset pipeline should not set
STATIC_FILES_PATH/STATIC_URL_PREFIX, and should includeassets:precompileinCC_RAKEGOALS. - Adds guidance for non-Rails Rack apps to configure
STATIC_FILES_PATH/STATIC_URL_PREFIXfor NGINX static serving. - Removes prior notes about
STATIC_URL_PREFIX=/and related static configuration caveats.
You can also share your feedback on Copilot code review. Take the survey.
Comment on lines
+94
to
99
| For a standard Rails application using the asset pipeline, you typically do not need to set `STATIC_FILES_PATH` or `STATIC_URL_PREFIX`. Rails serves assets through the application itself. Make sure to include the `assets:precompile` task in the `CC_RAKEGOALS` environment variable value: | ||
|
|
||
| ```bash | ||
| CC_RAKEGOALS="db:migrate, assets:precompile" | ||
| ``` | ||
|
|
| **Note**: if your project uses `webpacker`, make sure to enable the dedicated build instance option in the **Information** menu of your application in the Clever Cloud console because `webpacker` needs a lot a resources when starting. | ||
| If you need NGINX to serve static files directly (for example, for a non-Rails Rack application), configure these [environment variables](#setting-up-environment-variables-on-clever-cloud): | ||
|
|
||
| `STATIC_FILES_PATH`: should point to a directory where your static files are stored. The path must be absolute regarding the root of your application. |
Comment on lines
+104
to
105
| `STATIC_URL_PREFIX`: the URL path under which you want to serve static files (for example `/public/`). If not set, NGINX serves common static file extensions automatically. | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📝 What does this PR do?
This pull request updates the documentation for managing static files and assets in Ruby applications on Clever Cloud. The changes clarify how Rails applications should handle static files and when to use specific environment variables, making the instructions more accurate and easier to follow.
Documentation improvements for static file handling:
STATIC_FILES_PATHandSTATIC_URL_PREFIXdo not need to be set, as Rails serves assets itself. Emphasized the importance of includingassets:precompileinCC_RAKEGOALS.STATIC_FILES_PATHandSTATIC_URL_PREFIX, and explained default NGINX behavior if these are not set.🔗 Related Issue (if applicable)
🧪 Type of Change
✅ Quick Checklist