{"id":604,"date":"2018-01-15T10:44:14","date_gmt":"2018-01-15T01:44:14","guid":{"rendered":"https:\/\/t-office.blue\/?p=604"},"modified":"2018-01-17T05:56:11","modified_gmt":"2018-01-16T20:56:11","slug":"laravel%e5%ad%a6%e7%bf%92docker%e3%81%a7%e3%81%8b%e3%82%93%e3%81%9f%e3%82%93%e3%81%ab%e3%80%81laravel%e9%96%8b%e7%99%ba%e7%92%b0%e5%a2%83%e3%82%92%e4%bd%9c%e3%82%8b%e3%82%8c%e3%81%aa%e3%81%8b","status":"publish","type":"post","link":"https:\/\/wp.t-office.blue\/?p=604","title":{"rendered":"[Laravel\u5b66\u7fd2]Docker\u3067\u304b\u3093\u305f\u3093\u306b\u3001Laravel\u958b\u767a\u74b0\u5883\u3092\u4f5c\u308b(\u308c\u306a\u304b\u3063\u305f\u8a71\uff09(Part8)"},"content":{"rendered":"<p>\u4ee5\u524d\u304b\u3089\u6c17\u306b\u306f\u306a\u3063\u3066\u3044\u305fDocker\u3092\u4f7f\u3063\u3066Laravel\u306e\u958b\u767a\u74b0\u5883\u3092\u4f5c\u3063\u3066\u884c\u304d\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002\u3053\u308c\u307e\u3067\u306fVagrant\u3092\u4f7f\u3063\u3066\u4eee\u60f3\u30b5\u30fc\u30d0\u3092\u4f5c\u3063\u305f\u308a\u3057\u3066\u305f\u3051\u3069\u3001\u5bb9\u91cf\u304c\u5927\u304d\u304f\u306a\u308a\u3059\u304e\u3066\u3001\u4f7f\u3046\u306e\u304c\u5104\u52ab\u306b\u306a\u3063\u3066\u3044\u304f\u3002\u307e\u305f\u9650\u308a\u3042\u308b\u30ce\u30fc\u30c8PC\u306e\u5bb9\u91cf\u3092\u98df\u3044\u5c3d\u304f\u3059\u3068\u3044\u3046\u3053\u3068\u3067\u3001\u3053\u307e\u3063\u3066\u307e\u3057\u305f\u3002<\/p>\n<p>PC\u304c\u4fee\u7406\u304b\u3089\u8fd4\u3063\u3066\u304d\u3066\u3061\u3087\u3046\u3069\u3044\u3044\u3068\u601d\u3046\u306e\u3067\u3001Docker\u3067Laravel\u74b0\u5883\u3092\u4f5c\u308a\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<p>\u5e78\u3044\u306b\u3082Laradock\u3068\u3044\u3046\u306e\u3092\u4f7f\u3046\u3068\u304b\u3093\u305f\u3093\u306b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3067\u304d\u308b\u3088\u3046\u306a\u306e\u3067\u6311\u6226\u3057\u305f\u3044\u3068\u304a\u3082\u3044\u307e\u3059\u3002<\/p>\n<p>[\u76ee\u6b21]<\/p>\n<p>Docker\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<br \/>\nlaradoc<br \/>\nDocker\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<br \/>\nDocker\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u81ea\u4f53\u306f\u304b\u3093\u305f\u3093\u3067\u3059\u3002\u3053\u3053\u304b\u3089\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u3066dmg\u3092\u5c55\u958b\u3057\u3066\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u30d5\u30a9\u30eb\u30c0\u306b\u6398\u308a\u8fbc\u3080\u3060\u3051\uff08\u3044\u3064\u3082\u3068\u540c\u3058\uff09\u3067\u3059\u3002<\/p>\n<p>laradoc\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/p>\n<pre><code>$ mkdir laravel\n$ cd laravel\n$ git clone https:\/\/github.com\/LaraDock\/laradock.git\n\nAgreeing to the Xcode\/iOS license requires admin privileges, please run \u201csudo xcodebuild -license\u201d and then retry this command.\n\n<\/code><\/pre>\n<p>Xcode\u306eadmin\u6a29\u9650\u304c\u5fc5\u8981\u3068\u306e\u3053\u3068<\/p>\n<pre><code>$ sudo xcodebuild -license\n[Enter]\u3092\u62bc\u3059\u3068\u30e9\u30a4\u30bb\u30f3\u30b9\u304c\u51fa\u3066\u304f\u308b\n[q]\u3067\u9589\u3058\u308b\nagree[Enter]\u3067\u540c\u610f\n\n$ git clone https:\/\/github.com\/LaraDock\/laradock.git\nCloning into 'laradock'...\nremote: Counting objects: 6491, done.\nremote: Total 6491 (delta 0), reused 0 (delta 0), pack-reused 6491\nReceiving objects: 100% (6491\/6491), 6.08 MiB | 462.00 KiB\/s, done.\nResolving deltas: 100% (3423\/3423), done.\n<\/code><\/pre>\n<p>\u6b21\u306f\u3046\u307e\u304f\u3044\u304d\u307e\u3057\u305f\u3002<\/p>\n<pre><code>$ cp env-example .env\n$ vi docker-compose.yml\n$ docker-compose up -d nginx mysql redis beanstalkd\n\n<\/code><\/pre>\n<p>\u672c\u5f53\u306fapache\u3092\u5165\u308c\u305f\u304b\u3063\u305f\u3051\u3069nginx -&gt; apache\u3067\u7f6e\u304d\u63db\u3048\u3089\u308c\u306a\u304b\u3063\u305f\u306e\u3067\u3001\u305d\u306e\u307e\u307e\u5b9f\u884c\u3002<\/p>\n<p>\u7d50\u69cb\u65e9\u304f\u7d42\u308f\u308a\u307e\u3057\u305f\u3002\uff085\u5206\u3050\u3089\u3044\u3068\u304a\u3082\u3046\uff09<\/p>\n<p>[\u53c2\u8003\u30da\u30fc\u30b8]<\/p>\n<p>\u30b9\u30c6\u30fc\u30bf\u30b9\u3092\u78ba\u8a8d\u3059\u308b\u3068<\/p>\n<pre><code>$ docker-compose ps\nName Command State Ports\n--------------------------------------------------------------------------------\nlaradock_applications_ \/true Exit 0\n1\nlaradock_beanstalkd_1 \/usr\/bin\/beanstalkd Up 0.0.0.0:11300-&gt;11300\/\ntcp\nlaradock_mysql_1 docker-entrypoint.sh Up 0.0.0.0:3306-&gt;3306\/tc\nmysqld p\nlaradock_nginx_1 nginx Up 0.0.0.0:443-&gt;443\/tcp,\n0.0.0.0:80-&gt;80\/tcp\nlaradock_php-fpm_1 docker-php-entrypoint Up 9000\/tcp\nphp-fpm\nlaradock_redis_1 docker-entrypoint.sh Up 0.0.0.0:6379-&gt;6379\/tc\nredis ... p\nlaradock_workspace_1 \/sbin\/my_init Up 0.0.0.0:2222-&gt;22\/tcp\n<\/code><\/pre>\n<p>.env\u3092\u4fee\u6b63\u3057\u307e\u3059\u3002<\/p>\n<pre><code>## tacky2k add 2018.01.15(\u6708) 11:35\nDB_HOST=mysql\nREDIS_HOST=redis\nQUEUE_HOST=beanstalkd\n\n<\/code><\/pre>\n<p>\u306f\u3044404 NotFound\u3067\u307e\u3057\u305f\u3002<\/p>\n<p>\u53c2\u8003\u30b5\u30a4\u30c8\u306b\u3042\u308b\u3088\u3046\u306bLaravel\u306e\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3092\u4f5c\u6210\u3057\u306a\u3044\u3068\u3044\u3051\u306a\u3044\u3063\u307d\u3044\u306e\u3067\u3001\u4f5c\u308a\u307e\u3059\u3002<\/p>\n<p>\u30ef\u30fc\u30af\u30b9\u30da\u30fc\u30b9\uff08\u30b3\u30f3\u30c6\u30ca\uff09\u3078\u30ed\u30b0\u30a4\u30f3\u3067\u3059\u304c\u3001\u3042\u3093\u307e\u308a\u30b3\u30f3\u30c6\u30ca\u306e\u610f\u5473\u304c\u308f\u304b\u3063\u3066\u307e\u305b\u3093\u3002<\/p>\n<pre><code>$ docker exec -it laradock_workspace_1 \/bin\/bash\nroot@d30caee63cc7:\/var\/www# composer create-project laravel\/laravel testapp\nDo not run Composer as root\/super user! See https:\/\/getcomposer.org\/root for details\nInstalling laravel\/laravel (v5.5.28)\n- Installing laravel\/laravel (v5.5.28): Downloading (100%)\nCreated project in testapp\n&gt; @php -r \"file_exists('.env') || copy('.env.example', '.env');\"\nLoading composer repositories with package information\nUpdating dependencies (including require-dev)\nPackage operations: 70 installs, 0 updates, 0 removals\n- Installing symfony\/thanks (v1.0.1): Downloading (100%)\n- Installing hamcrest\/hamcrest-php (v2.0.0): Downloading (100%)\n- Installing mockery\/mockery (1.0): Downloading (100%)\n- Installing vlucas\/phpdotenv (v2.4.0): Downloading (100%)\n- Installing symfony\/css-selector (v4.0.3): Downloading (100%)\n- Installing tijsverkoyen\/css-to-inline-styles (2.2.1): Downloading (100%)\n- Installing symfony\/polyfill-mbstring (v1.6.0): Downloading (100%)\n- Installing symfony\/var-dumper (v3.4.3): Downloading (100%)\n- Installing symfony\/routing (v3.4.3): Downloading (100%)\n- Installing symfony\/process (v3.4.3): Downloading (100%)\n- Installing paragonie\/random_compat (v2.0.11): Downloading (100%)\n- Installing symfony\/polyfill-php70 (v1.6.0): Downloading (100%)\n- Installing symfony\/http-foundation (v3.4.3): Downloading (100%)\n- Installing symfony\/event-dispatcher (v4.0.3): Downloading (100%)\n- Installing psr\/log (1.0.2): Downloading (100%)\n- Installing symfony\/debug (v3.4.3): Downloading (100%)\n- Installing symfony\/http-kernel (v3.4.3): Downloading (100%)\n- Installing symfony\/finder (v3.4.3): Downloading (100%)\n- Installing symfony\/console (v3.4.3): Downloading (100%)\n- Installing doctrine\/lexer (v1.0.1): Downloading (100%)\n- Installing egulias\/email-validator (2.1.3): Downloading (100%)\n- Installing swiftmailer\/swiftmailer (v6.0.2): Downloading (100%)\n- Installing ramsey\/uuid (3.7.2): Downloading (100%)\n- Installing psr\/simple-cache (1.0.0): Downloading (100%)\n- Installing psr\/container (1.0.0): Downloading (100%)\n- Installing symfony\/translation (v3.4.3): Downloading (100%)\n- Installing nesbot\/carbon (1.22.1): Downloading (100%)\n- Installing mtdowling\/cron-expression (v1.2.1): Downloading (100%)\n- Installing monolog\/monolog (1.23.0): Downloading (100%)\n- Installing league\/flysystem (1.0.41): Downloading (100%)\n- Installing erusev\/parsedown (1.6.4): Downloading (100%)\n- Installing doctrine\/inflector (v1.3.0): Downloading (100%)\n- Installing laravel\/framework (v5.5.28): Downloading (100%)\n- Installing fideloper\/proxy (3.3.4): Downloading (100%)\n- Installing jakub-onderka\/php-console-color (0.1): Downloading (100%)\n- Installing jakub-onderka\/php-console-highlighter (v0.3.2): Downloading (100%)\n- Installing dnoegel\/php-xdg-base-dir (0.1): Downloading (100%)\n- Installing nikic\/php-parser (v3.1.3): Downloading (100%)\n- Installing psy\/psysh (v0.8.17): Downloading (100%)\n- Installing laravel\/tinker (v1.0.3): Downloading (100%)\n- Installing filp\/whoops (2.1.14): Downloading (100%)\n- Installing fzaninotto\/faker (v1.7.1): Downloading (100%)\n- Installing sebastian\/version (2.0.1): Downloading (100%)\n- Installing sebastian\/resource-operations (1.0.0): Downloading (100%)\n- Installing sebastian\/recursion-context (3.0.0): Downloading (100%)\n- Installing sebastian\/object-reflector (1.1.1): Downloading (100%)\n- Installing sebastian\/object-enumerator (3.0.3): Downloading (100%)\n- Installing sebastian\/global-state (2.0.0): Downloading (100%)\n- Installing sebastian\/exporter (3.1.0): Downloading (100%)\n- Installing sebastian\/environment (3.1.0): Downloading (100%)\n- Installing sebastian\/diff (2.0.1): Downloading (100%)\n- Installing sebastian\/comparator (2.1.2): Downloading (100%)\n- Installing doctrine\/instantiator (1.1.0): Downloading (100%)\n- Installing phpunit\/php-text-template (1.2.1): Downloading (100%)\n- Installing phpunit\/phpunit-mock-objects (5.0.6): Downloading (100%)\n- Installing phpunit\/php-timer (1.0.9): Downloading (100%)\n- Installing phpunit\/php-file-iterator (1.4.5): Downloading (100%)\n- Installing theseer\/tokenizer (1.1.0): Downloading (100%)\n- Installing sebastian\/code-unit-reverse-lookup (1.0.1): Downloading (100%)\n- Installing phpunit\/php-token-stream (2.0.2): Downloading (100%)\n- Installing phpunit\/php-code-coverage (5.3.0): Downloading (100%)\n- Installing webmozart\/assert (1.2.0): Downloading (100%)\n- Installing phpdocumentor\/reflection-common (1.0.1): Downloading (100%)\n- Installing phpdocumentor\/type-resolver (0.4.0): Downloading (100%)\n- Installing phpdocumentor\/reflection-docblock (4.2.0): Downloading (100%)\n- Installing phpspec\/prophecy (1.7.3): Downloading (100%)\n- Installing phar-io\/version (1.0.1): Downloading (100%)\n- Installing phar-io\/manifest (1.0.1): Downloading (100%)\n- Installing myclabs\/deep-copy (1.7.0): Downloading (100%)\n- Installing phpunit\/phpunit (6.5.5): Downloading (100%)\nsymfony\/var-dumper suggests installing ext-symfony_debug ()\nsymfony\/routing suggests installing doctrine\/annotations (For using the annotation loader)\nsymfony\/routing suggests installing symfony\/config (For using the all-in-one router or any loader)\nsymfony\/routing suggests installing symfony\/dependency-injection (For loading routes from a service)\nsymfony\/routing suggests installing symfony\/expression-language (For using expression matching)\nsymfony\/routing suggests installing symfony\/yaml (For using the YAML loader)\nparagonie\/random_compat suggests installing ext-libsodium (Provides a modern crypto API that can be used to generate random bytes.)\nsymfony\/event-dispatcher suggests installing symfony\/dependency-injection ()\nsymfony\/http-kernel suggests installing symfony\/browser-kit ()\nsymfony\/http-kernel suggests installing symfony\/config ()\nsymfony\/http-kernel suggests installing symfony\/dependency-injection ()\nsymfony\/console suggests installing symfony\/lock ()\nramsey\/uuid suggests installing ircmaxell\/random-lib (Provides RandomLib for use with the RandomLibAdapter)\nramsey\/uuid suggests installing ext-libsodium (Provides the PECL libsodium extension for use with the SodiumRandomGenerator)\nramsey\/uuid suggests installing ext-uuid (Provides the PECL UUID extension for use with the PeclUuidTimeGenerator and PeclUuidRandomGenerator)\nramsey\/uuid suggests installing moontoast\/math (Provides support for converting UUID to 128-bit integer (in string form).)\nramsey\/uuid suggests installing ramsey\/uuid-doctrine (Allows the use of Ramsey\\Uuid\\Uuid as Doctrine field type.)\nramsey\/uuid suggests installing ramsey\/uuid-console (A console application for generating UUIDs with ramsey\/uuid)\nsymfony\/translation suggests installing symfony\/config ()\nsymfony\/translation suggests installing symfony\/yaml ()\nmonolog\/monolog suggests installing aws\/aws-sdk-php (Allow sending log messages to AWS services like DynamoDB)\nmonolog\/monolog suggests installing doctrine\/couchdb (Allow sending log messages to a CouchDB server)\nmonolog\/monolog suggests installing ext-amqp (Allow sending log messages to an AMQP server (1.0+ required))\nmonolog\/monolog suggests installing ext-mongo (Allow sending log messages to a MongoDB server)\nmonolog\/monolog suggests installing graylog2\/gelf-php (Allow sending log messages to a GrayLog2 server)\nmonolog\/monolog suggests installing mongodb\/mongodb (Allow sending log messages to a MongoDB server via PHP Driver)\nmonolog\/monolog suggests installing php-amqplib\/php-amqplib (Allow sending log messages to an AMQP server using php-amqplib)\nmonolog\/monolog suggests installing php-console\/php-console (Allow sending log messages to Google Chrome)\nmonolog\/monolog suggests installing rollbar\/rollbar (Allow sending log messages to Rollbar)\nmonolog\/monolog suggests installing ruflin\/elastica (Allow sending log messages to an Elastic Search server)\nmonolog\/monolog suggests installing sentry\/sentry (Allow sending log messages to a Sentry server)\nleague\/flysystem suggests installing league\/flysystem-aws-s3-v2 (Allows you to use S3 storage with AWS SDK v2)\nleague\/flysystem suggests installing league\/flysystem-aws-s3-v3 (Allows you to use S3 storage with AWS SDK v3)\nleague\/flysystem suggests installing league\/flysystem-azure (Allows you to use Windows Azure Blob storage)\nleague\/flysystem suggests installing league\/flysystem-cached-adapter (Flysystem adapter decorator for metadata caching)\nleague\/flysystem suggests installing league\/flysystem-eventable-filesystem (Allows you to use EventableFilesystem)\nleague\/flysystem suggests installing league\/flysystem-rackspace (Allows you to use Rackspace Cloud Files)\nleague\/flysystem suggests installing league\/flysystem-sftp (Allows you to use SFTP server storage via phpseclib)\nleague\/flysystem suggests installing league\/flysystem-webdav (Allows you to use WebDAV storage)\nleague\/flysystem suggests installing league\/flysystem-ziparchive (Allows you to use ZipArchive adapter)\nleague\/flysystem suggests installing spatie\/flysystem-dropbox (Allows you to use Dropbox storage)\nleague\/flysystem suggests installing srmklive\/flysystem-dropbox-v2 (Allows you to use Dropbox storage for PHP 5 applications)\nlaravel\/framework suggests installing aws\/aws-sdk-php (Required to use the SQS queue driver and SES mail driver (~3.0).)\nlaravel\/framework suggests installing doctrine\/dbal (Required to rename columns and drop SQLite columns (~2.5).)\nlaravel\/framework suggests installing guzzlehttp\/guzzle (Required to use the Mailgun and Mandrill mail drivers and the ping methods on schedules (~6.0).)\nlaravel\/framework suggests installing league\/flysystem-aws-s3-v3 (Required to use the Flysystem S3 driver (~1.0).)\nlaravel\/framework suggests installing league\/flysystem-cached-adapter (Required to use Flysystem caching (~1.0).)\nlaravel\/framework suggests installing league\/flysystem-rackspace (Required to use the Flysystem Rackspace driver (~1.0).)\nlaravel\/framework suggests installing nexmo\/client (Required to use the Nexmo transport (~1.0).)\nlaravel\/framework suggests installing pda\/pheanstalk (Required to use the beanstalk queue driver (~3.0).)\nlaravel\/framework suggests installing predis\/predis (Required to use the redis cache and queue drivers (~1.0).)\nlaravel\/framework suggests installing pusher\/pusher-php-server (Required to use the Pusher broadcast driver (~3.0).)\nlaravel\/framework suggests installing symfony\/dom-crawler (Required to use most of the crawler integration testing tools (~3.3).)\nlaravel\/framework suggests installing symfony\/psr-http-message-bridge (Required to psr7 bridging features (~1.0).)\npsy\/psysh suggests installing ext-pdo-sqlite (The doc command requires SQLite to work.)\npsy\/psysh suggests installing hoa\/console (A pure PHP readline implementation. You'll want this if your PHP install doesn't already support readline or libedit.)\nfilp\/whoops suggests installing whoops\/soap (Formats errors as SOAP responses)\nsebastian\/global-state suggests installing ext-uopz (*)\nphpunit\/phpunit-mock-objects suggests installing ext-soap (*)\nphpunit\/php-code-coverage suggests installing ext-xdebug (^2.5.5)\nphpunit\/phpunit suggests installing phpunit\/php-invoker (^1.1)\nphpunit\/phpunit suggests installing ext-xdebug (*)\nWriting lock file\nGenerating optimized autoload files\n&gt; Illuminate\\Foundation\\ComposerScripts::postAutoloadDump\n&gt; @php artisan package:discover\nDiscovered Package: fideloper\/proxy\nDiscovered Package: laravel\/tinker\nPackage manifest generated successfully.\n&gt; @php artisan key:generate\nApplication key [base64:nk41Z5EqidHp5qIBO8G926W3+jPmuVvHRZvst75QEKM=] set successfully.\nroot@d30caee63cc7:\/var\/www#\n<\/code><\/pre>\n<p>root\u3067\u3084\u3093\u306a\u3088\uff01\u307f\u305f\u3044\u306a\u8b66\u544a\u306f\u51fa\u3066\u3044\u308b\u3051\u3069\u3001\u3046\u307e\u304f\u3044\u304d\u307e\u3057\u305f\u3002<\/p>\n<p>exit\u3057\u3066docker-compose\u3092\u505c\u3081\u307e\u3059\u3002<\/p>\n<pre><code>root@d30caee63cc7:\/var\/www# exit\nexit\ntacky2k@MacBook:~\/homepage\/laravel\/laradock$ docker-compose stop\nStopping laradock_nginx_1 ... done\nStopping laradock_beanstalkd_1 ... done\nStopping laradock_php-fpm_1 ... done\nStopping laradock_workspace_1 ... done\nStopping laradock_mysql_1 ... done\nStopping laradock_redis_1 ... done\n<\/code><\/pre>\n<p>\u3053\u3053\u307e\u3067\u6765\u3066\u3001\u8272\u3005\u554f\u984c\u304c\u767a\u751f\u3002<br \/>\n\u3053\u306e\u72b6\u614b\u3067mysql\u3082\u52d5\u3044\u3066\u308b\u3057nginx\u3082\u52d5\u3044\u3066\u3044\u308b\u3093\u3060\u3051\u3069\u3001\u3069\u3046\u3082laravel\u3068mysql8.0\u3068\u3044\u3046\u30d0\u30fc\u30b8\u30e7\u30f3\u90fd\u5408\u304c\u60aa\u3044\u3063\u307d\u3044(laravel\u3068\u306e\u76f8\u6027\u3068\u8a00\u3046\u306e\u306f\u5618\u304b\u3082\u3057\u308c\u306a\u3044\u3051\u3069)\u3002\u52a0\u3048\u3066nginx\u3082\u666e\u6bb5\u4f7f\u3063\u3066\u306a\u3044\u306e\u3067\u4f7f\u3044\u52dd\u624b\u304c\u60aa\u3044\u304b\u3089apache2\u306b\u4e57\u308a\u63db\u3048\u3092\u884c\u3044\u307e\u3057\u305f\u3002<\/p>\n<pre><code>#\u3059\u3067\u306b\u3057\u3066\u3042\u308c\u3070\u4e0d\u8981\n$docker-compose stop\n\n$docker-compose rm\n\n#\u3053\u306e\u30b3\u30de\u30f3\u30c9\u3067apache2\u304c\u4f7f\u3048\u308b\u3088\u3046\u306b\u306a\u3063\u305f\u3002\n$docker-compose up -d apache2 mysql redis beanstalkde\n<\/code><\/pre>\n<p>docker-compose.yml\u3068\u3044\u3046laradoc\u76f4\u4e0b\u306e\u30d5\u30a1\u30a4\u30eb\u3092\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u66f8\u304d\u63db\u3048.<br \/>\nvolumes:\u3068\u305d\u306e\u6b21\u306e\u884c\u8ffd\u52a0<\/p>\n<pre><code>### Applications Code Container #############################\n\napplications:\nimage: tianon\/true\nvolumes:\n- ${APPLICATION}\/tanba-events:\/var\/www\n### Workspace Utilities Container ###########################\n<\/code><\/pre>\n<p>mysql\u30928.0->5.7\u306b\u30d0\u30fc\u30b8\u30e7\u30f3\u30c0\u30a6\u30f3<br \/>\n\u3053\u308c\u3082\u30eb\u30fc\u30c8(laradoc\u76f4\u4e0b)\u306e.env\u306b\u304b\u304b\u308c\u3066\u3044\u308b\u3082\u306e\u3092\u5909\u66f4(web\u3067\u30b0\u30b0\u308b\u3068.env\u3067\u7ba1\u7406\u3055\u308c\u3066\u306a\u3044\u6642\u4ee3\u306e\u60c5\u5831\u304c\u51fa\u3066\u304d\u3066\u56f0\u3063\u305f\uff09<br \/>\nMYSQL\u3067\u30b0\u30b0\u3063\u3066\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u66f8\u304d\u63db\u3048\u305f<\/p>\n<pre><code>#MYSQL_VERSION=8.0\nMYSQL_VERSION=5.7\nMYSQL_DATABASE=tanba-events\nMYSQL_USER=user\nMYSQL_PASSWORD=secret\nMYSQL_PORT=3306\nMYSQL_ROOT_PASSWORD=root\nMYSQL_ENTRYPOINT_INITDB=.\/mysql\/docker-entrypoint-initdb.d\n<\/code><\/pre>\n<p>MYSQL_VERSION\u30925.7\u306b\u3002<br \/>\nMYSQL_DATABASE=tanba-events \u3053\u308c\u306f\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u540d\uff08\u81ea\u5206\u3067\u8a2d\u5b9a\u3002\u672c\u756a\u306b\u5408\u308f\u305b\u3066\u304a\u3051\u3070\u826f\u3044\u3068\u601d\u3044\u307e\u3059\u3002\uff09<br \/>\nMYSQL_USER=user (\u3053\u308c\u306f\u5f8c\u3005\u9762\u5012\u306a\u306e\u3067\u3001[user]\u304c\u3044\u3044\u3058\u3083\u306a\u3044\u3067\u3057\u3087\u3046\u304b\uff1f\u3082\u3061\u308d\u3093\u5909\u3048\u3066\u3082\u3044\u3044\uff09<br \/>\nMYSQL_PASSWORD=secret\u3000\uff08\u3053\u308c\u3082MYSQL_USER\u306e\u8aac\u660e\u3068\u4e00\u7dd2\uff09<\/p>\n<p>\u6b21\u306bapache2\u306e\u8a2d\u5b9a<br \/>\nlaradoc\/apache2\/Dockerfile\u3092\u4fee\u6b63<\/p>\n<pre><code>#ubuntu16.04-&amp;gt;centos-7\u3078\u5909\u66f4\n#FROM webdevops\/apache:ubuntu-16.04\nFROM webdevops\/apache:centos-7\n\nMAINTAINER Eric Pfeiffer &amp;lt;computerfr33k@users.noreply.github.com&amp;gt;\n\nARG PHP_UPSTREAM_CONTAINER=php-fpm\nARG PHP_UPSTREAM_PORT=9000\nARG PHP_UPSTREAM_TIMEOUT=60\n\nENV WEB_PHP_SOCKET=${PHP_UPSTREAM_CONTAINER}:${PHP_UPSTREAM_PORT}\n\n#Documentroot\u3092\u5909\u66f4\nENV WEB_DOCUMENT_ROOT=\/var\/www\/tanba-events\n\nENV WEB_PHP_TIMEOUT=${PHP_UPSTREAM_TIMEOUT}\n\nEXPOSE 80 443\n\n#\u3053\u3053\u306f\u5909\u66f4\u4e0d\u8981\u304b\u3082\nWORKDIR \/var\/www\/tanba-events\n\nCOPY vhost.conf \/etc\/apache2\/sites-enabled\/vhost.conf\n\nENTRYPOINT [\"\/opt\/docker\/bin\/entrypoint.sh\"]\n\nCMD [\"supervisord\"]\n\n<\/code><\/pre>\n<p>\u3053\u308c\u3067Docker\u30b3\u30f3\u30c6\u30ca\u3092\u518d\u69cb\u7bc9<\/p>\n<pre><code>$ docker-compose up -d apache2 mysql redis beanstalkd\n<\/code><\/pre>\n<p>\u3057\u3070\u3089\u304f\u6642\u9593\u304c\u304b\u304b\u308b\u3051\u3069\u3046\u307e\u304f\u3044\u304f\u306e\u3067\u306f\u306a\u3044\u3060\u308d\u3046\u304b\u3002<\/p>\n<p>apache2\u306b\u30ed\u30b0\u30a4\u30f3<\/p>\n<pre><code>$ docker exec -it laradock_apache2_1 \/bin\/bash\n[root@3519f0a0178b tanba-events]# pwd\n\/var\/www\/tanba-events\n[root@3519f0a0178b tanba-events]# ls\napp composer.json database phpunit.xml routes vendor\nartisan composer.lock index.php public storage webpack.mix.js\nbootstrap config package.json resources tests yarn.lock\n[root@3519f0a0178b tanba-events]# vi \/etc\/httpd\/conf\/httpd.conf\n\n# DocumentRoot \"\/var\/www\/html\"\nDocumentRoot \"\/var\/www\/tanba-events\"\n\n# &amp;lt;Directory \"\/var\/www\/tanba-events\"&amp;gt;\n&amp;lt;Directory \"\/var\/www\/html\"&amp;gt;\n\n[root@3519f0a0178b tanba-events]# service httpd restart\n\n[root@3519f0a0178b tanba-events]# exit\n<\/code><\/pre>\n<p>\u3053\u308c\u3067\u52d5\u304f\u3088\u3046\u306b\u306a\u308b\u306f\u305a\u3002<\/p>\n<p>docker\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3000https:\/\/qiita.com\/kurkuru\/items\/fa7401a01c4d5dd98e4a<br \/>\nlaradoc\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3000https:\/\/qiita.com\/kurkuru\/items\/6ce0b9c4632b944347b8<br \/>\n<a href=\"https:\/\/qiita.com\/meidaimae\/items\/1b5902e2e520ece34b9a\" title=\"https:\/\/qiita.com\/meidaimae\/items\/1b5902e2e520ece34b9a\">https:\/\/qiita.com\/meidaimae\/items\/1b5902e2e520ece34b9a<\/a><br \/>\n<a href=\"https:\/\/day-journal.com\/memo\/laravel-001\/\" title=\"https:\/\/day-journal.com\/memo\/laravel-001\/\">https:\/\/day-journal.com\/memo\/laravel-001\/<\/a><br \/>\n<a href=\"http:\/\/laradock.io\/documentation\/#change-the-php-fpm-version\" title=\"http:\/\/laradock.io\/documentation\/#change-the-php-fpm-version\">http:\/\/laradock.io\/documentation\/#change-the-php-fpm-version<\/a><\/p>\n<p><a href=\"https:\/\/qiita.com\/k-waragai\/items\/ad46d0875eb745705512\" title=\"https:\/\/qiita.com\/k-waragai\/items\/ad46d0875eb745705512\">https:\/\/qiita.com\/k-waragai\/items\/ad46d0875eb745705512<\/a><br \/>\n<a href=\"https:\/\/qiita.com\/tifa2chan\/items\/e9aa408244687a63a0ae\" title=\"https:\/\/qiita.com\/tifa2chan\/items\/e9aa408244687a63a0ae\">https:\/\/qiita.com\/tifa2chan\/items\/e9aa408244687a63a0ae<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4ee5\u524d\u304b\u3089\u6c17\u306b\u306f\u306a\u3063\u3066\u3044\u305fDocker\u3092\u4f7f\u3063\u3066Laravel\u306e\u958b\u767a\u74b0\u5883\u3092\u4f5c\u3063\u3066\u884c\u304d\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002\u3053\u308c\u307e\u3067\u306fVagrant\u3092\u4f7f\u3063\u3066\u4eee\u60f3\u30b5\u30fc\u30d0\u3092\u4f5c\u3063\u305f\u308a\u3057\u3066\u305f\u3051\u3069\u3001\u5bb9\u91cf\u304c\u5927\u304d\u304f\u306a\u308a\u3059\u304e\u3066\u3001\u4f7f\u3046\u306e\u304c\u5104\u52ab\u306b\u306a\u3063\u3066\u3044\u304f\u3002\u307e\u305f\u9650\u308a\u3042 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[40,54,1],"tags":[],"class_list":["post-604","post","type-post","status-publish","format-standard","hentry","category-laravel","category-mac","category-1"],"_links":{"self":[{"href":"https:\/\/wp.t-office.blue\/index.php?rest_route=\/wp\/v2\/posts\/604","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wp.t-office.blue\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wp.t-office.blue\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wp.t-office.blue\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/wp.t-office.blue\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=604"}],"version-history":[{"count":5,"href":"https:\/\/wp.t-office.blue\/index.php?rest_route=\/wp\/v2\/posts\/604\/revisions"}],"predecessor-version":[{"id":610,"href":"https:\/\/wp.t-office.blue\/index.php?rest_route=\/wp\/v2\/posts\/604\/revisions\/610"}],"wp:attachment":[{"href":"https:\/\/wp.t-office.blue\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=604"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wp.t-office.blue\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=604"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wp.t-office.blue\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=604"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}