local-dev.sh: start a working container end to end
- mkdir of user/logs/{apache,system} was quoted (literal {apache,system} dir) and is no longer needed: the entrypoint creates logs itself
- drop the /var/log and /etc/httpd/logs bind mounts, which collided with the entrypoint (mv of /var/log/httpd: Device or resource busy, then 'unsafe entry' refusal to start)
- read credentials from /home/<user>/mysql_creds (where the entrypoint writes them), not /var/lib/mysql/creds
- -a N (and the default 83) now selects the image tag cac:phpNN instead of always pulling latest (latest is PHP 8.5); validated; CAC_IMAGE overrides for a locally built image
- wait for the container to be healthy (or fail with its logs) instead of sleep 160; WordPress download runs as the user and only into an empty web root
- instance_logs/instance_db_info use docker logs / the right creds path
- new flags -d (DOCROOT_SUBDIR) and -x (XDEBUG) and PUBLIC_HTTPS_PORT are passed through; they take effect with the image changes in the following commits
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0185ukXi4YX5FxJGqhi6qab6
This commit is contained in:
1 parent
d4ec8b526c
commit
ce9fd87183
4 files changed
+323
-38
No files matched your search
@@ -29,14 +29,17 @@ The easiest way to start a local development environment is with the provided `l
|
||||
- `-p` HTTP port (default: 80)
|
||||
- `-s` HTTPS port (default: 443)
|
||||
- `-r` Root path for files and database (default: current directory)
|
||||
- `-a` PHP version (default: 8.3; options: 74, 80, 81, 82, 83, 84, 85, 86)
|
||||
- `-a` PHP version (default: 83; options: 74, 80, 81, 82, 83, 84, 85, 86). Selects the image tag `cac:phpNN`
|
||||
- `-d` Web root folder inside `public_html`, e.g. `public` for Laravel / CodeIgniter 4 (sets `DOCROOT_SUBDIR`)
|
||||
- `-x` Install and enable Xdebug (sets `XDEBUG=1`, see [Debugging](#debugging-with-xdebug-dev-mode-only))
|
||||
- `-v` Enable verbose mode
|
||||
- `-h` Show help
|
||||
|
||||
The script will:
|
||||
- Create a user directory and log folders
|
||||
- Create a Docker volume for MySQL
|
||||
- Start the container with the correct environment variables
|
||||
- Pull and start `cac:php<NN>` for the version you asked for, with the correct environment variables
|
||||
- Wait until the container is healthy (first start installs MariaDB and memcached, about a minute)
|
||||
- Generate helper scripts in your root path:
|
||||
- `instance_start` – Start the container
|
||||
- `instance_stop` – Stop the container
|
||||
|
||||
Reference in new issue
Block a user