![]() sql file is a bit more complex due to how Docker interacts with the file system, but it's still very doable. vessel dump | gzip > ~/Sites/example/ Importing a Database # Export the database, gzip it, save it to vessel dump > ~/Sites/example/example.sql This outputs to stdout You'll need to redirect the output to a file on your local file system: # Export the database and save it to example.sql Vessel has a shortcut to allow you to export the database configured in the. This requires the MySQL container to be running. This will also run use your_database, where "your_database" is the database set by your DB_DATABASE environment variable. Vessel has a shortcut to allow you to log into MySQL. ![]() You'll likely find yourself needing to perform some MySQL operations. The Port setting in Sequel Pro must match the MYSQL_PORT environment variable, which defaults to 3306. The password for user root is set by environment variable DB_PASSWORD from within the. Since we bind the MySQL to port 3306, Sequel Pro can access the database directly. MYSQL_PORT is set so you can connect to your MySQL container from a client such as Sequel Pro.APP_PORT is set so you can connect to the app container from your browser.This port setup is merely convenience to communicate into your containers from the outside world: For example, your PHP code will connect to MySQL on port 3306 no matter what (there's no reason to change the DB_PORT env var). Within the containers (which are all within a Docker network), software and containers communicate to eachother over the default ports. Instead, it only changes what port is forwarded from your host machine into the containers. Note that changing APP_PORT and MYSQL_PORT does not change the fact that Nginx listens on port 80 and MySQL listens on port 3306. Then you can view your project at and access your database locally from port 33060. Or when starting Vessel: APP_PORT=8080 MYSQL_PORT=33060. To get around this, use a different port per project by setting the APP_PORT and MYSQL_PORT environment variables in one of two ways: However, if you run more than one instance of Vessel, you'll get an error when starting it Each port can only be used once. Vessel attempts to bind to port on your machine, so you can simply go to in your browser. If you are using Gulp, you can continue to use that as well./vessel gulp You may prefer to install and run tasks with Yarn./vessel yarn # Run nodejsĪny NPM command can be run, such as npm install foo. NodeĪny Node command can be run, such as node index.js. This container isn't actively running but can be used whenever you like. Vessel also builds a container with NodeJS, NPM, Yarn, and Gulp. vessel test tests/Unit/SpecificTest.php You can use any commands or flags you would normally use with phpunit as well./vessel test -filter= Vessel has the test command to help us out here. We can use Vessel to run our tests as well! This is especially useful if you test with your database or SQLite. # Here we kill the container with ID 0770015f9257 vessel start), you can find the ID of the running container and "kill" it: # Find the running instance of the vessel/app container, However, if ctrl+c doesn't work (which can happen if you start a worker before running. To stop a queue worker, you can use ctrl+c as usual. vessel artisan queue:work -tries=3 -sleep=3 # Sleep 3 seconds before polling for more jobs # Give jobs 3 tries before deleting/marking as failed ![]() You can run them like any other artisan commands ( Laravel queue worker docs here): # Just like from Laravel docs Queue workers are just another artisan command. Additionally, all commands are run relative to your project root directory (the same directory that your Laravel application resides). Just use the php command: # List php CLI modules:Īll commands and flags are passed along to PHP. vessel artisan migrate -seedĪd-hoc PHP commands can be run within Vessel. ![]() For example, to run migrations and seed the database, use. vessel art # "art" is a shortcut to "artisan"Īll commands and flags are passed along to Artisan. We can use artisan or art for short./vessel artisan In those cases, we'll need Vessel to run the artisan commands. vessel composer require aws/aws-sdk-phpĪrtisan commands can be run directly on your host machine as well, except when they interact with the cache or database. vessel comp # "comp" is a shortcut to "composer"įor example, to install the AWS SDK, run. You can use vessel's composer command or comp command for short. Often you can run Composer directly as usual, but you can run them within Vessel as well. Here's how to run your everyday commands. Vessel aims to make your everyday development easy, as if you're not using Docker at all.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |