index.xml 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  1. <?xml version="1.0" encoding="utf-8" standalone="yes" ?>
  2. <rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  3. <channel>
  4. <title>Getting-starteds on Laradock Docs</title>
  5. <link>http://laradock.io/getting-started/index.xml</link>
  6. <description>Recent content in Getting-starteds on Laradock Docs</description>
  7. <generator>Hugo -- gohugo.io</generator>
  8. <language>en-us</language>
  9. <atom:link href="http://laradock.io/getting-started/index.xml" rel="self" type="application/rss+xml" />
  10. <item>
  11. <title>Getting started</title>
  12. <link>http://laradock.io/getting-started/</link>
  13. <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
  14. <guid>http://laradock.io/getting-started/</guid>
  15. <description>
  16. &lt;p&gt;&lt;a name=&#34;Requirements&#34;&gt;&lt;/a&gt;&lt;/p&gt;
  17. &lt;h2 id=&#34;requirements:d680e8a854a7cbad6d490c445cba2eba&#34;&gt;Requirements&lt;/h2&gt;
  18. &lt;ul&gt;
  19. &lt;li&gt;&lt;a href=&#34;https://git-scm.com/downloads&#34;&gt;Git&lt;/a&gt;&lt;/li&gt;
  20. &lt;li&gt;&lt;a href=&#34;https://www.docker.com/products/docker/&#34;&gt;Docker&lt;/a&gt; &lt;code&gt;&amp;gt;= 1.12&lt;/code&gt;&lt;/li&gt;
  21. &lt;/ul&gt;
  22. &lt;p&gt;&lt;a name=&#34;Installation&#34;&gt;&lt;/a&gt;&lt;/p&gt;
  23. &lt;h2 id=&#34;installation:d680e8a854a7cbad6d490c445cba2eba&#34;&gt;Installation&lt;/h2&gt;
  24. &lt;p&gt;Choose the setup the best suits your needs.&lt;/p&gt;
  25. &lt;h4 id=&#34;a-setup-for-single-project:d680e8a854a7cbad6d490c445cba2eba&#34;&gt;A) Setup for Single Project:&lt;/h4&gt;
  26. &lt;p&gt;&lt;em&gt;(In case you want a Docker environment for each project)&lt;/em&gt;&lt;/p&gt;
  27. &lt;h5 id=&#34;a-1-setup-environment-in-existing-project:d680e8a854a7cbad6d490c445cba2eba&#34;&gt;A.1) Setup environment in existing Project:&lt;/h5&gt;
  28. &lt;p&gt;&lt;em&gt;(In case you already have a project, and you want to setup an environment to run it)&lt;/em&gt;&lt;/p&gt;
  29. &lt;p&gt;1 - Clone this repository on your project root directory:&lt;/p&gt;
  30. &lt;pre&gt;&lt;code class=&#34;language-bash&#34;&gt;git submodule add https://github.com/Laradock/laradock.git
  31. &lt;/code&gt;&lt;/pre&gt;
  32. &lt;p&gt;&lt;em&gt;Note 1: If you are not yet using Git for your PHP project, you can use &lt;code&gt;git clone https://github.com/Laradock/laradock.git&lt;/code&gt; instead.&lt;/em&gt;&lt;/p&gt;
  33. &lt;p&gt;&lt;em&gt;Note 2: To keep track of your LaraDock changes, between your projects and also keep LaraDock updated. &lt;a href=&#34;#keep-tracking-LaraDock&#34;&gt;Check this&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;
  34. &lt;p&gt;&lt;em&gt;Note 3: In this case the folder structure will be like this:&lt;/em&gt;&lt;/p&gt;
  35. &lt;pre&gt;&lt;code&gt;- project1
  36. - laradock
  37. - project2
  38. - laradock
  39. &lt;/code&gt;&lt;/pre&gt;
  40. &lt;h5 id=&#34;a-2-setup-environment-first-then-create-project:d680e8a854a7cbad6d490c445cba2eba&#34;&gt;A.2) Setup environment first then create project:&lt;/h5&gt;
  41. &lt;p&gt;&lt;em&gt;(In case you don&#39;t have a project, and you want to create your project inside the Docker environment)&lt;/em&gt;&lt;/p&gt;
  42. &lt;p&gt;1 - Clone this repository anywhere on your machine:&lt;/p&gt;
  43. &lt;pre&gt;&lt;code class=&#34;language-bash&#34;&gt;git clone https://github.com/laradock/laradock.git
  44. &lt;/code&gt;&lt;/pre&gt;
  45. &lt;p&gt;Note: In this case the folder structure will be like this:&lt;/p&gt;
  46. &lt;pre&gt;&lt;code&gt;- projects
  47. - laradock
  48. - myProject
  49. &lt;/code&gt;&lt;/pre&gt;
  50. &lt;p&gt;2 - Edit the &lt;code&gt;docker-compose.yml&lt;/code&gt; file to map to your project directory once you have it (example: &lt;code&gt;- ../myProject:/var/www&lt;/code&gt;).&lt;/p&gt;
  51. &lt;p&gt;3 - Stop and re-run your docker-compose command for the changes to take place.&lt;/p&gt;
  52. &lt;pre&gt;&lt;code&gt;docker-compose stop &amp;amp;&amp;amp; docker-compose up -d XXXX YYYY ZZZZ ....
  53. &lt;/code&gt;&lt;/pre&gt;
  54. &lt;h4 id=&#34;b-setup-for-multiple-projects:d680e8a854a7cbad6d490c445cba2eba&#34;&gt;B) Setup for Multiple Projects:&lt;/h4&gt;
  55. &lt;p&gt;1 - Clone this repository anywhere on your machine:&lt;/p&gt;
  56. &lt;pre&gt;&lt;code class=&#34;language-bash&#34;&gt;git clone https://github.com/laradock/laradock.git
  57. &lt;/code&gt;&lt;/pre&gt;
  58. &lt;p&gt;2 - Edit the &lt;code&gt;docker-compose.yml&lt;/code&gt; file to map to your projects directories:&lt;/p&gt;
  59. &lt;pre&gt;&lt;code&gt; applications:
  60. image: tianon/true
  61. volumes:
  62. - ../project1/:/var/www/project1
  63. - ../project2/:/var/www/project2
  64. &lt;/code&gt;&lt;/pre&gt;
  65. &lt;p&gt;3 - You can access all sites by visiting &lt;code&gt;http://localhost/project1/public&lt;/code&gt; and &lt;code&gt;http://localhost/project2/public&lt;/code&gt; but of course that&#39;s not very useful so let&#39;s setup NGINX quickly.&lt;/p&gt;
  66. &lt;p&gt;4 - Go to &lt;code&gt;nginx/sites&lt;/code&gt; and copy &lt;code&gt;sample.conf.example&lt;/code&gt; to &lt;code&gt;project1.conf&lt;/code&gt; then to &lt;code&gt;project2.conf&lt;/code&gt;&lt;/p&gt;
  67. &lt;p&gt;5 - Open the &lt;code&gt;project1.conf&lt;/code&gt; file and edit the &lt;code&gt;server_name&lt;/code&gt; and the &lt;code&gt;root&lt;/code&gt; as follow:&lt;/p&gt;
  68. &lt;pre&gt;&lt;code&gt; server_name project1.dev;
  69. root /var/www/project1/public;
  70. &lt;/code&gt;&lt;/pre&gt;
  71. &lt;p&gt;Do the same for each project &lt;code&gt;project2.conf&lt;/code&gt;, &lt;code&gt;project3.conf&lt;/code&gt;,...&lt;/p&gt;
  72. &lt;p&gt;6 - Add the domains to the &lt;strong&gt;hosts&lt;/strong&gt; files.&lt;/p&gt;
  73. &lt;pre&gt;&lt;code&gt;127.0.0.1 project1.dev
  74. &lt;/code&gt;&lt;/pre&gt;
  75. &lt;p&gt;7 - Create your project Databases. Right now you have to do it manually by entering your DB container, until we automate it soon.&lt;/p&gt;
  76. &lt;p&gt;&lt;a name=&#34;Usage&#34;&gt;&lt;/a&gt;&lt;/p&gt;
  77. &lt;h2 id=&#34;usage:d680e8a854a7cbad6d490c445cba2eba&#34;&gt;Usage&lt;/h2&gt;
  78. &lt;p&gt;&lt;strong&gt;Read Before starting:&lt;/strong&gt;&lt;/p&gt;
  79. &lt;p&gt;If you are using &lt;strong&gt;Docker Toolbox&lt;/strong&gt; (VM), do one of the following:&lt;/p&gt;
  80. &lt;ul&gt;
  81. &lt;li&gt;Upgrade to Docker &lt;a href=&#34;https://www.docker.com/products/docker&#34;&gt;Native&lt;/a&gt; for Mac/Windows (Recommended). Check out &lt;a href=&#34;#upgrading-laradock&#34;&gt;Upgrading LaraDock&lt;/a&gt;&lt;/li&gt;
  82. &lt;li&gt;Use LaraDock v3.* (Visit the &lt;code&gt;LaraDock-ToolBox&lt;/code&gt; &lt;a href=&#34;https://github.com/laradock/laradock/tree/LaraDock-ToolBox&#34;&gt;Branch&lt;/a&gt;).&lt;/li&gt;
  83. &lt;/ul&gt;
  84. &lt;p&gt;&lt;br&gt;&lt;/p&gt;
  85. &lt;blockquote&gt;
  86. &lt;p&gt;&lt;strong&gt;Warning:&lt;/strong&gt; If you used an older version of LaraDock it&#39;s highly recommended to rebuild the containers you need to use &lt;a href=&#34;#Build-Re-build-Containers&#34;&gt;see how you rebuild a container&lt;/a&gt; in order to prevent errors as much as possible.&lt;/p&gt;
  87. &lt;/blockquote&gt;
  88. &lt;p&gt;&lt;br&gt;&lt;/p&gt;
  89. &lt;p&gt;1 - Run Containers: &lt;em&gt;(Make sure you are in the &lt;code&gt;laradock&lt;/code&gt; folder before running the &lt;code&gt;docker-compose&lt;/code&gt; commands).&lt;/em&gt;&lt;/p&gt;
  90. &lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt; Running NGINX and MySQL:&lt;/p&gt;
  91. &lt;pre&gt;&lt;code class=&#34;language-bash&#34;&gt;docker-compose up -d nginx mysql
  92. &lt;/code&gt;&lt;/pre&gt;
  93. &lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: The &lt;code&gt;workspace&lt;/code&gt; and &lt;code&gt;php-fpm&lt;/code&gt; will run automatically in most of the cases, so no need to specify them in the &lt;code&gt;up&lt;/code&gt; command. If you couldn&#39;t find them running then you need specify them as follow: &lt;code&gt;docker-compose up -d nginx php-fpm mysql workspace&lt;/code&gt;.&lt;/p&gt;
  94. &lt;p&gt;You can select your own combination of Containers form the list below:&lt;/p&gt;
  95. &lt;p&gt;&lt;code&gt;nginx&lt;/code&gt;, &lt;code&gt;hhvm&lt;/code&gt;, &lt;code&gt;php-fpm&lt;/code&gt;, &lt;code&gt;mysql&lt;/code&gt;, &lt;code&gt;redis&lt;/code&gt;, &lt;code&gt;postgres&lt;/code&gt;, &lt;code&gt;mariadb&lt;/code&gt;, &lt;code&gt;neo4j&lt;/code&gt;, &lt;code&gt;mongo&lt;/code&gt;, &lt;code&gt;apache2&lt;/code&gt;, &lt;code&gt;caddy&lt;/code&gt;, &lt;code&gt;memcached&lt;/code&gt;, &lt;code&gt;beanstalkd&lt;/code&gt;, &lt;code&gt;beanstalkd-console&lt;/code&gt;, &lt;code&gt;rabbitmq&lt;/code&gt;, &lt;code&gt;workspace&lt;/code&gt;, &lt;code&gt;phpmyadmin&lt;/code&gt;, &lt;code&gt;aerospike&lt;/code&gt;, &lt;code&gt;pgadmin&lt;/code&gt;, &lt;code&gt;elasticsearch&lt;/code&gt;, &lt;code&gt;rethinkdb&lt;/code&gt;.&lt;/p&gt;
  96. &lt;p&gt;&lt;br&gt;
  97. 2 - Enter the Workspace container, to execute commands like (Artisan, Composer, PHPUnit, Gulp, ...).&lt;/p&gt;
  98. &lt;pre&gt;&lt;code class=&#34;language-bash&#34;&gt;docker-compose exec workspace bash
  99. &lt;/code&gt;&lt;/pre&gt;
  100. &lt;p&gt;Alternatively, for Windows PowerShell users: execute the following command to enter any running container:&lt;/p&gt;
  101. &lt;pre&gt;&lt;code class=&#34;language-bash&#34;&gt;docker exec -it {workspace-container-id} bash
  102. &lt;/code&gt;&lt;/pre&gt;
  103. &lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; You can add &lt;code&gt;--user=laradock&lt;/code&gt; (example &lt;code&gt;docker-compose exec --user=laradock workspace bash&lt;/code&gt;) to have files created as your host&#39;s user. (you can change the PUID (User id) and PGID (group id) variables from the &lt;code&gt;docker-compose.yml&lt;/code&gt;).&lt;/p&gt;
  104. &lt;p&gt;&lt;br&gt;
  105. 3 - Edit your project configurations.&lt;/p&gt;
  106. &lt;p&gt;Open your &lt;code&gt;.env&lt;/code&gt; file and set the &lt;code&gt;DB_HOST&lt;/code&gt; to &lt;code&gt;mysql&lt;/code&gt;:&lt;/p&gt;
  107. &lt;pre&gt;&lt;code class=&#34;language-env&#34;&gt;DB_HOST=mysql
  108. &lt;/code&gt;&lt;/pre&gt;
  109. &lt;p&gt;&lt;em&gt;If you want to use Laravel and you don&#39;t have it installed yet, see &lt;a href=&#34;#Install-Laravel&#34;&gt;How to Install Laravel in a Docker Container&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;
  110. &lt;p&gt;&lt;br&gt;
  111. 4 - Open your browser and visit your localhost address (&lt;code&gt;http://localhost/&lt;/code&gt;).&lt;/p&gt;
  112. &lt;p&gt;&lt;br&gt;
  113. &lt;strong&gt;Debugging&lt;/strong&gt;: if you are facing any problem here check the &lt;a href=&#34;#debugging&#34;&gt;Debugging&lt;/a&gt; section.&lt;/p&gt;
  114. &lt;p&gt;If you need a special support. Contact me, more details in the &lt;a href=&#34;#Help&#34;&gt;Help &amp;amp; Questions&lt;/a&gt; section.&lt;/p&gt;
  115. </description>
  116. </item>
  117. </channel>
  118. </rss>