1506 WIP: First draft of write heavy volumes documentation.#1519
1506 WIP: First draft of write heavy volumes documentation.#1519JDDoesDev wants to merge 1 commit intodocksal:developfrom
Conversation
|
Is the container name available as a variable? In case someone might want to create a custom command to handle the syncing. I wouldn't want to have to look that rsync command and path up every time if it were me. |
| @@ -0,0 +1,93 @@ | |||
| --- | |||
| title: "Increasing Performance by Keeping Write-heavy Volumes Inside Containers" | |||
There was a problem hiding this comment.
Titles have to be short to fit on a single line (ideally) in the sidebar.
| title: "Increasing Performance by Keeping Write-heavy Volumes Inside Containers" | |
| title: "Write-heavy Volumes" |
| need to rely on mounts to the host to read or write data. | ||
|
|
||
| The process of keeping write-heavy volumes inside containers involves mounting certain folders as volumes within the CLI container and | ||
| interacting with the data directly through the container. For example, in a Composer-based Drupal project, the `/vendor` folder is usually pretty large |
There was a problem hiding this comment.
| interacting with the data directly through the container. For example, in a Composer-based Drupal project, the `/vendor` folder is usually pretty large | |
| interacting with the data directly through the container filesystem. For example, in a Composer-based Drupal project, the `vendor` folder is usually pretty large |
| and mounted at the defined locations within your container. | ||
|
|
||
| Because these volumes are only accessible within the container, any commands that interact with them _MUST_ be run within the container. For example, | ||
| if you normally run `composer install` outside of the container and rely on the bind mount to link the host data to the container data, you will need |
There was a problem hiding this comment.
Note: Running composer install directly on the host is not a good practice. I can see why users would be doing so, but it should be highly discouraged.
| Assuming that your `cli` container is named `drupal9`, the command to sync the `vendor` folder from container to host without deleting files would be: | ||
|
|
||
| ``` | ||
| rsync -e 'docker exec -i' -avP drupal9_cli_1:/var/www/vendor ./vendor |
There was a problem hiding this comment.
Yes! This should be a built-in command in fin (#1524)
|
@shelane and @lmakarov I have written a custom command, but I didn't use a variable name. I'd imagine that you could add the container name as an environment variable and pass that to the command itself. Here is a gist of what I have as a custom command https://gist.github.com/JDDoesDev/8049b64619530cce8469e22cd4ae837f and I am going to be including a link to it in the docs. |
This is a first draft of the documentation for write heavy volumes documentation as mentioned in #1506 for initial feedback.
DO NOT MERGE
Preview link: https://deploy-preview-1519--docs-docksal-io.netlify.app/use-cases/write-heavy-volumes/