# AI Rules for Docker Interactions

When executing commands or modifying code that requires interacting with the Docker environment (e.g., PHP, MySQL, Artisan, Composer), you MUST adhere to the following rules:

1. **Verify Container & Project Name**: Before running any docker command, always verify the active container name and the project name (e.g., by running `docker ps` or checking existing configuration files) to ensure you are executing commands in the correct environment.
2. **Docker Exec Format**: Run commands inside the Docker container using `docker exec`.
   - Example: `docker exec <container_name> bash -c "cd /var/www/html/<project_name> && php artisan <command>"`
   - If interactive TTY is not supported, do not use the `-it` flag. Use `-i` or `-t` carefully, or omit them for non-interactive automated commands.
3. **Handling Passwords**: If a command requires a password (e.g., connecting to MySQL `mysql -u root -p`), DO NOT try to guess it or force it. Pause execution and **ASK THE USER** for the password or the preferred method to proceed.
4. **Database Access**: For MySQL interactions, ensure you connect to the correct database container or through the application container if MySQL is accessible there. Provide commands that the user can copy-paste if a password prompt is interactive and blocks the automated terminal.
5. **Permissions**: Do not change file permissions (`chmod`/`chown`) blindly unless absolutely necessary for the framework (e.g., `storage`/`bootstrap/cache` in Laravel) to avoid breaking host-container permission mapping.
