Skip to content
This repository was archived by the owner on Sep 14, 2021. It is now read-only.

Conversation

@benlk
Copy link

@benlk benlk commented Jun 2, 2021

Description of the Change

Answers the following questions:

  • Where's php.ini?
  • Why didn't my edits to docker-compose.yml or docker-php-ext-xdebug.ini take effect?
  • How do I make changes work?

This is in response to a series of comments, from 10up and external users, who didn't know these things. By writing them down, hopefully we'll improve people's ability to use 10up's WP Local Docker

It also appears to address #42

Alternate Designs

  • I considered putting the configuration instructions at the bottom of Environments.md, but putting them between "Create" and "Restart" seemed to make more sense, given the typical workflow of an engineer creating an environment for the first time.
  • I considered leaving off the full instructions that I had written for rebuilding a container, but to do would have left users without an example workflow.

Benefits

  • Improved ability for users to configure environments
  • Fewer support requests

Possible Drawbacks

  • Slightly messier
  • The internal link to another headline on the page might break

Verification Process

  • I'm relying on GitHub's Markdown Editor's syntax checker
  • I don't have a copy of this site building anywhere.

Checklist:

  • I have read the CONTRIBUTING document.
  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my change.
  • All new and existing tests passed.

Applicable Issues

#42

Changelog Entry

(omitted because this documentation project does not have a changelog)

Answers the following questions
- Where's `php.ini`?
- How do I increase process memory limits?
- Why didn't my edits to `docker-compose.yml` or `docker-php-ext-xdebug.ini` take effect?
- How do I make changes work?
Copy link
Collaborator

@eugene-manuilov eugene-manuilov left a comment

Choose a reason for hiding this comment

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

Thanks, @tylercherpak. Added some comments. Would like to hear @dustinrue feedback as well.

Comment on lines +47 to +48
- `elasticsearch/`
- `elasticsearch.yml`
Copy link
Collaborator

Choose a reason for hiding this comment

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

We also have a volume mount intended for plugin configurations:

./config/elasticsearch/plugins:/usr/share/elasticsearch/plugins:cached

I am not sure how exactly it works. @dustinrue do you know what we can put there?

- `wp-cli.develop.yml`
- `wp-cli.local.yml`

After making changes to files in `config/` or to `docker-compose.yml`, you must recreate the containers. Instructions for doing so can be found on this page under [Restart an environment](#restart-an-environment)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
After making changes to files in `config/` or to `docker-compose.yml`, you must recreate the containers. Instructions for doing so can be found on this page under [Restart an environment](#restart-an-environment)
After making changes to files in `config/` or to `docker-compose.yml`, you must restart the containers. Instructions for doing so can be found on this page under [Restart an environment](#restart-an-environment)

Copy link
Author

Choose a reason for hiding this comment

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

I specifically used "recreate" here because the word "restart" is associated with 10updocker restart, which will not perform the necessary actions. The user needs to do something other than simply restarting the dockers.

Reference this user's complaints about restarting not applying the changes: https://10up.slack.com/archives/CRB61GWJZ/p1622574490045900 . I'm linking to Slack so that you can see how their frustration with restarts not applying the changes led them to comment in multiple tickets. If we use "restart" in this case in the docs, future users will experience similar frustrations.


A special hostname `all` is available that will restart all environments as well as the global services.

Restarting with `10updocker restart` does not apply configuration changes. If you've made changes to an environment's `docker-compose.yml` or the files in `/config` directory, you will need to stop the environment (but not global services) and then run [`docker-compose up`](https://docs.docker.com/compose/reference/up/) to recreate the containers:
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
Restarting with `10updocker restart` does not apply configuration changes. If you've made changes to an environment's `docker-compose.yml` or the files in `/config` directory, you will need to stop the environment (but not global services) and then run [`docker-compose up`](https://docs.docker.com/compose/reference/up/) to recreate the containers:
Restarting with `10updocker restart` does not apply configuration changes. If you've made changes to an environment's `docker-compose.yml` or the files in `/config` directory, you will need to stop the environment (but not global services) and then start it again to make containers re-read changes from the docker-compose file and re-mount configs:

Copy link
Author

Choose a reason for hiding this comment

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

A simple 10updocker restart does not work. The changes are not applied until docker-compose up is run.

Comment on lines +70 to +72
2. Run `10updocker stop all` to stop all environments, including the global services.
3. Run `10updocker start` to get this install and the global services running.
4. Run `10updocker stop` to stop this install but not the global services.
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think we don't need to run stop all and start commands. Just stop is enough:

Suggested change
2. Run `10updocker stop all` to stop all environments, including the global services.
3. Run `10updocker start` to get this install and the global services running.
4. Run `10updocker stop` to stop this install but not the global services.
2. Run `10updocker stop` to stop this install but not the global services.

Copy link
Author

Choose a reason for hiding this comment

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

The reason I'm having the user go through the dance of stop all, start, stop is because docker-compose up fails if the global services are not running. The dance ensures that the global services are running.

It also ensures that no other environments are running. Modifying one environment ought not to modify any others, but I'd like to remove even the possibility of that happening by not having any other environments running. We don't know what else is going on in the user's computer; this helps eliminate any potential sources of interference.

Comment on lines +73 to +75
5. Run [`docker-compose up`](https://docs.docker.com/compose/reference/up/) to recreate and start this install's docker containers. Wait for it to finish starting; this can be determined by watching the console output. Don't load the site in a browser. If there hasn't been anything new on the console for at least 10 seconds, you can proceed to the next step.
6. Kill the newly-started docker process with the `Control-C` keyboard command, or your system's equivalent instruction.
7. Run `10updocker restart` to restart the container.
Copy link
Collaborator

Choose a reason for hiding this comment

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

And these steps are not necessary as well:

Suggested change
5. Run [`docker-compose up`](https://docs.docker.com/compose/reference/up/) to recreate and start this install's docker containers. Wait for it to finish starting; this can be determined by watching the console output. Don't load the site in a browser. If there hasn't been anything new on the console for at least 10 seconds, you can proceed to the next step.
6. Kill the newly-started docker process with the `Control-C` keyboard command, or your system's equivalent instruction.
7. Run `10updocker restart` to restart the container.
1. Run `10updocker start` to start containers.

Copy link
Author

Choose a reason for hiding this comment

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

These steps are necessary. 10updocker restart or 10updocker stop; 10updocker start does not apply the changes. See 10up/wp-local-docker-v2#86 (comment)

Copy link
Contributor

Choose a reason for hiding this comment

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

@eugene-manuilov is this a bug then? I have also experienced similar behavior with the restart command.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants