Compare commits
694 Commits
Author | SHA1 | Date | |
---|---|---|---|
01c358b6bc | |||
a0685705c0 | |||
98b2b2e47b | |||
eeee14338f | |||
a2edf57e3b | |||
881cbfb8c2 | |||
6cff904eba | |||
04770bc4ec | |||
1281490c39 | |||
3f7988060e | |||
615cb72eab | |||
e036e69da2 | |||
8989c73711 | |||
61144ab2d9 | |||
221edf4bb2 | |||
5a073ae841 | |||
8c1e71eca5 | |||
c0e823b8d2 | |||
8cb4c8d62e | |||
f765afd4c2 | |||
6ea49a0683 | |||
998aa1365e | |||
f2420ec52c | |||
fe254e86e3 | |||
53b7f75500 | |||
4150f0b140 | |||
d340b6e60f | |||
e7357eab83 | |||
110aa91c59 | |||
e5aef41dd2 | |||
ae048e6c66 | |||
a5f3a92eb4 | |||
655b9a1526 | |||
7ac37ecd35 | |||
792789e479 | |||
801ccd47d2 | |||
5c5f94600a | |||
b2e372054f | |||
0a23d53ee5 | |||
f6552aca97 | |||
e9806d9bca | |||
e56801846b | |||
f9e6acd4e1 | |||
b61ff4f484 | |||
8485add87a | |||
d3fb967f0f | |||
a36620c3bd | |||
cddc934e1e | |||
53b3ad0f7e | |||
fdcf9117ac | |||
f800a3221a | |||
a1d3eeb7e6 | |||
b2f7348552 | |||
ebeddcba23 | |||
dba37307b5 | |||
2af5b2ff49 | |||
93d5b318fe | |||
9ce470e14e | |||
38fb49bccc | |||
08896f9fb6 | |||
dcab211b07 | |||
76001daf71 | |||
30b626d43e | |||
586a225c11 | |||
c099a51d52 | |||
245ddf3441 | |||
0192346cf2 | |||
e4f4de47e7 | |||
69ccd74d2e | |||
a3c66fdecf | |||
9b8eee6a98 | |||
668acd66c1 | |||
b25215684b | |||
8e84fbbec2 | |||
1e650d8643 | |||
4977b0f92f | |||
2082659fb1 | |||
1fe2df73e4 | |||
05c7f9186a | |||
3801973b15 | |||
6d89424e91 | |||
b1c1e6e187 | |||
972bdd90a3 | |||
2af40b0ba1 | |||
5c0b8316b1 | |||
004e4354aa | |||
d99cf73bf0 | |||
a365425c73 | |||
c836500488 | |||
318ca3f81c | |||
82219ededb | |||
d6ff224b0d | |||
b1144bba7e | |||
a590ed78ce | |||
f852789720 | |||
d32cfb31b1 | |||
e671f4c929 | |||
aef2769e60 | |||
63816ab7d6 | |||
e7a16bb98e | |||
e496a82150 | |||
f258b38a18 | |||
a80fb99d21 | |||
6b0ee10988 | |||
1e2d368e43 | |||
829a5b5acf | |||
112e31a933 | |||
8af22b5b37 | |||
7029118f05 | |||
a1f8ef9614 | |||
97d198e967 | |||
722e73a3e6 | |||
1d2f385586 | |||
7b180524e3 | |||
a670dd91cd | |||
a0f1d39ce4 | |||
6bed8d14f1 | |||
e26ff8bb1e | |||
7fdda613a5 | |||
b7d3691c8d | |||
b0a6f2d689 | |||
8e20ec7617 | |||
a38cecef92 | |||
3bf572b7a4 | |||
2acc9f5d6f | |||
abae2dc09e | |||
407fb7a395 | |||
0c1b6ba9bf | |||
855e2a47b5 | |||
988bbf7bde | |||
ef7f251654 | |||
3d29c62bfb | |||
3e5d1d919a | |||
a38794ebcc | |||
56ca814ebb | |||
c17abbea6e | |||
0d5080d6bb | |||
e9a01c0174 | |||
5ea7b98db8 | |||
5eae7f3006 | |||
d83c9be2ea | |||
9585a4a7ab | |||
42fc8b7b57 | |||
0aa63c40f8 | |||
f59b9ebda6 | |||
b2c6e53bfa | |||
9970a00533 | |||
3752f48249 | |||
0baf791728 | |||
11687ffd36 | |||
aa22f5d648 | |||
00a38fe274 | |||
fe096ce282 | |||
b4ca9c5596 | |||
d85b76f0d1 | |||
f2a9712041 | |||
09bf0566af | |||
b8c5163c03 | |||
9dda2f6b9f | |||
ca5a1ee674 | |||
0e93477db0 | |||
7765df1076 | |||
fe38f0c2ff | |||
7ec8b8846e | |||
422d6d8dd0 | |||
d021777b06 | |||
f2f665dc08 | |||
02e2454c79 | |||
9d2be424de | |||
bf60f7520b | |||
916e9f38f3 | |||
ebc24ced66 | |||
3e59a2a813 | |||
50834268a7 | |||
007017a2a7 | |||
094aa9beb1 | |||
19f9b25a46 | |||
bc1c957f47 | |||
7c9f9c1ecd | |||
63152e11fa | |||
27c6de1fb1 | |||
70e01125fd | |||
26d7fb01ed | |||
d181a69a73 | |||
106f8ec7af | |||
1951834150 | |||
4c732aa5d6 | |||
bbbd247653 | |||
c35445b066 | |||
72198ed38c | |||
ab464d93d3 | |||
e56587ec47 | |||
bbea2f0bab | |||
9db39ad36f | |||
f009ba752b | |||
03b551f9d6 | |||
30df311ec2 | |||
262b9f20a3 | |||
3eb8fce4f9 | |||
05f8166bef | |||
1bdf113767 | |||
392960dc98 | |||
26ee54a4ad | |||
cbfd160cbf | |||
7207ccbbeb | |||
6e09e2a774 | |||
0561199914 | |||
430a5f21cf | |||
0290142bf4 | |||
5745a50d15 | |||
18b6c1b907 | |||
4a663649c0 | |||
7c9d7a6de6 | |||
d0e5d50712 | |||
d0c0a8895e | |||
e23ecb6a11 | |||
da60b32a04 | |||
5a47080859 | |||
f296a39bf5 | |||
f04acee6df | |||
992c76d29c | |||
f3a016aa79 | |||
58995966ec | |||
c913c429c0 | |||
d4caddcaed | |||
8d7b3a84be | |||
fc8ffe5731 | |||
bf691337f1 | |||
9e81f92d58 | |||
bf4a5beb0b | |||
3288c20658 | |||
5a8df95fd3 | |||
43545cefd2 | |||
71364f962e | |||
b2ad5f16e8 | |||
5dc4db40f7 | |||
cec83afe45 | |||
01f6d8f038 | |||
a90a3c1d28 | |||
a1bc99ef4e | |||
35efcc4a7c | |||
c85fd97e00 | |||
895a24f332 | |||
6ff7f4a402 | |||
109e596417 | |||
20fddc6de7 | |||
1eaac78fdd | |||
855241d966 | |||
be9f7f8346 | |||
b5431bc061 | |||
783da59b59 | |||
41574fe026 | |||
848398d443 | |||
4dfc794b6e | |||
ac895209f0 | |||
b24d6224d9 | |||
8a13ae1bb9 | |||
a2058ca6f6 | |||
aab2017bda | |||
f9266a509d | |||
546ef0ade6 | |||
4661f1ab0e | |||
264bec8806 | |||
e2d60be3e5 | |||
e1e9830348 | |||
0e0dc44a49 | |||
533c8fc7f7 | |||
07651842b6 | |||
3796f9f70a | |||
31d21c74a0 | |||
c6245fdaf8 | |||
c539c630ed | |||
a414e5434f | |||
08b35e63d6 | |||
1598868445 | |||
3134221445 | |||
4cf5f3eabf | |||
3a3e58de4c | |||
26ecb09685 | |||
6db5bc0162 | |||
eab859fe80 | |||
1d6c369c06 | |||
05faf24582 | |||
e454d1c8a7 | |||
f162864e89 | |||
69c9202304 | |||
100a2eb4ae | |||
59293d7a99 | |||
02958c06fe | |||
a6e2a6ee59 | |||
cf30e159fb | |||
9f12f63aea | |||
e8aad1238e | |||
6843f508fa | |||
3b0e4cd05d | |||
e8b49a9fe5 | |||
15d7cd1d35 | |||
61f74b5307 | |||
a81686d9d0 | |||
2f010506eb | |||
4f24550463 | |||
7f7d8839eb | |||
e579b18794 | |||
fde406bafa | |||
4cb440504b | |||
aa5e8e6666 | |||
61aabf664e | |||
c31e002064 | |||
61168cb9d3 | |||
da58d2e9b9 | |||
57616901fd | |||
623d7aa58d | |||
2710723d88 | |||
e0d5fb03ed | |||
ca198b85bf | |||
f339c3f055 | |||
207cb2929a | |||
bedb663a8e | |||
5a5dceb967 | |||
369fbded81 | |||
06b9dd3327 | |||
b9b9d52e57 | |||
767fbddde9 | |||
3e63afb907 | |||
f6fe749da3 | |||
e5fbc623eb | |||
02a512dd72 | |||
d5883e4bcf | |||
5815549a9a | |||
b2821b85ab | |||
9413f2c86f | |||
47150da482 | |||
1e6ee4a7b5 | |||
1be9df7d61 | |||
8246863cd7 | |||
5291f0f884 | |||
d44873085b | |||
956b9209bf | |||
080fffba3d | |||
fd47c89736 | |||
ae72b00e29 | |||
74ba0ef0a8 | |||
db353fbbdc | |||
f6f89fca61 | |||
c979878288 | |||
68ef6235c1 | |||
a94b4e259c | |||
988750e737 | |||
c7a726cd59 | |||
6348d032c9 | |||
6bf9ac877b | |||
dde95043f8 | |||
4bf0df8ee1 | |||
1db18b1cec | |||
c6bd305b13 | |||
49f245b37a | |||
ef6071bff0 | |||
690137a349 | |||
24d70ad1e3 | |||
1310d633fc | |||
bccb1a3162 | |||
0cf26af724 | |||
00ba765d80 | |||
481ac821de | |||
613eb1e51d | |||
4d1aee0fbe | |||
79101cd8fe | |||
c1a2f4b2a8 | |||
0b11b874d2 | |||
80991483bc | |||
b1c546efc9 | |||
f714954033 | |||
7614b1f626 | |||
a44cae4408 | |||
bdc6ea851f | |||
a5adf85e2d | |||
7f540ed7e2 | |||
0f7b6bab6b | |||
39f0eaf328 | |||
e92286c381 | |||
e022e7163f | |||
5c95bb3a0f | |||
bce05e4b59 | |||
4ce1d7f64a | |||
d0effd9468 | |||
5aab3add44 | |||
2a7c11a6bf | |||
1a0f978625 | |||
3a2845a00d | |||
fef6ec86b3 | |||
c5105c29b6 | |||
4dda815980 | |||
a6ff3d0666 | |||
0549936547 | |||
407353e6eb | |||
a7624a7034 | |||
f30e36bc93 | |||
b9716e7fef | |||
cc520c18b5 | |||
c67fa5b258 | |||
3d6b6ba271 | |||
677b9170ca | |||
92511ab8a8 | |||
393d20472a | |||
5b9dd242f3 | |||
a91bd19739 | |||
ba32dedbef | |||
df87c3e36b | |||
425d344e97 | |||
73ebc1effa | |||
bb8bf6ae10 | |||
5f3e0a9109 | |||
f7090a47a4 | |||
8ffb0ff3e3 | |||
f14b3b32cf | |||
3a8bd8a015 | |||
efc23a693d | |||
1235304a0d | |||
13952f3468 | |||
4a88cbc17a | |||
dc71a125c3 | |||
5d1660567c | |||
57ee5d96a4 | |||
919e0a75cd | |||
43ace2bebe | |||
07ad461e75 | |||
9f4aaa9bc7 | |||
ae01a9fd49 | |||
94a383bea9 | |||
375f733def | |||
74efa008da | |||
5a496bafeb | |||
3a7e6e4b1a | |||
f3598c3c97 | |||
4fd73ac512 | |||
747f956d01 | |||
1519d2c64c | |||
43f4f80836 | |||
ca7726c441 | |||
c78eb5228a | |||
81053c0868 | |||
b1367d237f | |||
603207cc2b | |||
43e2b3e403 | |||
f69422e82f | |||
96e82d4115 | |||
6d4a2c4cc4 | |||
f8e5f73e18 | |||
cdc2811d7b | |||
32d26c3e10 | |||
b482d4d901 | |||
ad00284a22 | |||
a835c9e709 | |||
597f922db7 | |||
cdb456a9b5 | |||
714902d12a | |||
657d8535a6 | |||
0594681760 | |||
f5478cfef5 | |||
e10217c64d | |||
f91def64d7 | |||
f991123545 | |||
86ebbfbdd3 | |||
a35287b367 | |||
ddabb4620e | |||
b86211d2d8 | |||
0b414813aa | |||
7dbe65e5f8 | |||
ef38dd1532 | |||
4b91fb1212 | |||
80a60d58cf | |||
1257f8830a | |||
8ed8bfdc2a | |||
042eb9e5e8 | |||
15cac480fe | |||
02e867c17d | |||
d51cd31ebc | |||
ea354cf035 | |||
0d4bacecd8 | |||
86197c9b62 | |||
f8fd92fb0a | |||
61b038e0d9 | |||
5b60b7ffb8 | |||
6e1911bdd5 | |||
d376074936 | |||
64b985f005 | |||
cc50339bcb | |||
8820501644 | |||
07021b01f4 | |||
13891a52dd | |||
a1bbe23800 | |||
2b5fdc00ee | |||
68ff573904 | |||
3a62814fdc | |||
da043ee0c4 | |||
5cd6ea41f9 | |||
d321be888c | |||
7230b11d3b | |||
7b9ec17d8d | |||
18b38db037 | |||
adfb468913 | |||
43f4211abb | |||
b1b8585518 | |||
d8fd1a5de0 | |||
585baf0668 | |||
f99eff3a99 | |||
ff4b913396 | |||
e861348475 | |||
b0831240b1 | |||
37dee56bb7 | |||
2b11fc2299 | |||
754ca4cd4f | |||
10e3dc16d2 | |||
e23c6dae90 | |||
96c1d7c59c | |||
c574943e16 | |||
3226206267 | |||
63543b890a | |||
b58f859eff | |||
170a1efeb1 | |||
50e3d1667f | |||
269732d8ea | |||
a11206d4ba | |||
cb78a6c3d6 | |||
662280c139 | |||
68dd2fd019 | |||
c193c5d03b | |||
4efb5b43c6 | |||
3d2eb81cd5 | |||
a8d7937889 | |||
98c9fdff24 | |||
f05512fd1d | |||
fc460f9497 | |||
1fd55d98e1 | |||
4f5746f2a7 | |||
3d90a806fa | |||
cf9abcd5b8 | |||
e1036185ae | |||
d1af24736b | |||
236665d7d3 | |||
c340d851d3 | |||
38545cfffd | |||
bf19ecffcb | |||
6fa6d02360 | |||
e588f261f8 | |||
5d5545ec9e | |||
d152050e29 | |||
a0da2c0ea0 | |||
2e86243d88 | |||
6b61c7d454 | |||
3881a5d66d | |||
69b223a370 | |||
894cb6ea27 | |||
b81e3e8f15 | |||
7d49f9b820 | |||
9dad1586af | |||
d60178f598 | |||
5d74e10b08 | |||
40422ab4b0 | |||
b35a23d89e | |||
3445b5b1b6 | |||
8315a3872d | |||
6abea8746c | |||
09c5ad273c | |||
99b8a45f3b | |||
4f416da26b | |||
53b73798d3 | |||
c6e9b1ed5d | |||
4973dd93be | |||
9096737aa7 | |||
3429681f2c | |||
d4c727bb2d | |||
1ae104167a | |||
8869b22a1d | |||
1650af04cd | |||
bdcc2adf3f | |||
570be592bb | |||
d94de05fd4 | |||
69c180d2e8 | |||
134911843a | |||
d31ccbd268 | |||
2bbe39cf4a | |||
4588685e97 | |||
4b2ddfad20 | |||
516b148dae | |||
0c53eadf34 | |||
3e61554625 | |||
6054c2d250 | |||
5589a12b9d | |||
e2384e2722 | |||
d077085595 | |||
53f1032975 | |||
875ec23ade | |||
cee9de7ed1 | |||
badad156e1 | |||
8e89725381 | |||
2219177eac | |||
baf29b1223 | |||
5c0933d19a | |||
8de9eca8ae | |||
d172180660 | |||
9f78b17fd1 | |||
f5e33fb396 | |||
9ae6e45dda | |||
94d88e91c5 | |||
8b4901ce57 | |||
08086be4c5 | |||
f2805bca52 | |||
033e1b8721 | |||
9e290ffddb | |||
6ada2f1b91 | |||
c6e393f5ce | |||
4e443cec09 | |||
528b60eb17 | |||
aedc7c8438 | |||
ec4ccb4a20 | |||
de6040a14d | |||
e0e4616ae0 | |||
c00fe5d7e0 | |||
30cf27e011 | |||
dcec8a46a8 | |||
1c7e2e7d85 | |||
1d6583e97e | |||
1cf5bcde62 | |||
db40c67f75 | |||
e10ba9fa9f | |||
a42a295951 | |||
0678415663 | |||
73a3745cc3 | |||
bed0fd9bdb | |||
3f1d4b70a6 | |||
218ffe641e | |||
be39e93ea2 | |||
783c9321c9 | |||
c62ce7d36f | |||
8ee2229c84 | |||
735647bdf7 | |||
f61535427c | |||
0d41c3d65e | |||
cbd3cf7c20 | |||
d505871faf | |||
9c14954ff4 | |||
fd0cbff16c | |||
246814874c | |||
1250668267 | |||
d616545268 | |||
faa42d8651 | |||
ab1d5bae95 | |||
7f27073a4e | |||
1a80385a48 | |||
c88e690bb4 | |||
c1de398acc | |||
73f7c88122 | |||
f7b94ac599 | |||
ff39e6045d | |||
07ebd5f69b | |||
36fcc6674e | |||
37ed904f1a | |||
7a343f168f | |||
0ac0166068 | |||
048b55186e | |||
57ecd6e515 | |||
25c2768557 | |||
1d918a71d8 | |||
9e3f8dd43d | |||
46fcb9e09c | |||
603010cbd5 | |||
48710f19c3 | |||
0983cc98fe | |||
6be81f05c2 | |||
8317fbde5c | |||
b45f395996 | |||
59dfacee13 | |||
a6e0338245 | |||
f610aa63d1 | |||
966a84fa39 | |||
356dc36fd5 | |||
c112fdffc1 | |||
fa9ac1e471 | |||
3f13aa4f50 | |||
474504f1d3 | |||
ca45806aaa | |||
4947dfaad1 | |||
7b542618f0 | |||
5b5ba53112 | |||
bd87a26db1 | |||
c0283da6ee | |||
aabe504c24 | |||
b401c517b2 | |||
e372d624a6 | |||
d89a944e22 | |||
48f8f3c02d | |||
4030cc2f26 | |||
db6c6e7e0f |
@ -9,4 +9,4 @@ charset = utf-8
|
||||
|
||||
[{Dockerfile,docker-compose.yml}]
|
||||
indent_style = space
|
||||
indent_size = 4
|
||||
indent_size = 2
|
||||
|
46
.github/CODE_OF_CONDUCT.md
vendored
Normal file
@ -0,0 +1,46 @@
|
||||
# Contributor Covenant Code of Conduct
|
||||
|
||||
## Our Pledge
|
||||
|
||||
In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
|
||||
|
||||
## Our Standards
|
||||
|
||||
Examples of behavior that contributes to creating a positive environment include:
|
||||
|
||||
* Using welcoming and inclusive language
|
||||
* Being respectful of differing viewpoints and experiences
|
||||
* Gracefully accepting constructive criticism
|
||||
* Focusing on what is best for the community
|
||||
* Showing empathy towards other community members
|
||||
|
||||
Examples of unacceptable behavior by participants include:
|
||||
|
||||
* The use of sexualized language or imagery and unwelcome sexual attention or advances
|
||||
* Trolling, insulting/derogatory comments, and personal or political attacks
|
||||
* Public or private harassment
|
||||
* Publishing others' private information, such as a physical or electronic address, without explicit permission
|
||||
* Other conduct which could reasonably be considered inappropriate in a professional setting
|
||||
|
||||
## Our Responsibilities
|
||||
|
||||
Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
|
||||
|
||||
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
|
||||
|
||||
## Scope
|
||||
|
||||
This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
|
||||
|
||||
## Enforcement
|
||||
|
||||
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at mahmoud@zalt.me. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
|
||||
|
||||
Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
|
||||
|
||||
## Attribution
|
||||
|
||||
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]
|
||||
|
||||
[homepage]: http://contributor-covenant.org
|
||||
[version]: http://contributor-covenant.org/version/1/4/
|
3
.github/CONTRIBUTING.md
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
### First off, thanks for taking the time to contribute!
|
||||
|
||||
For the contribution guide [click here](http://laradock.io/contributing/).
|
23
.github/ISSUE_TEMPLATE.md
vendored
Normal file
@ -0,0 +1,23 @@
|
||||
### Info:
|
||||
- Docker version (`$ docker --version`):
|
||||
- Laradock commit (`$ git rev-parse HEAD`):
|
||||
- System info (Mac, PC, Linux):
|
||||
- System info disto/version:
|
||||
|
||||
### Issue:
|
||||
<!--- What seems to be wrong? -->
|
||||
_____
|
||||
|
||||
### Expected behavior:
|
||||
<!--- What should happen instead? -->
|
||||
_____
|
||||
|
||||
### Reproduce:
|
||||
<!--- How can we reproduce the error? -->
|
||||
_____
|
||||
|
||||
### Relevant Code:
|
||||
|
||||
```
|
||||
// place a code sample here
|
||||
```
|
7
.github/PULL_REQUEST_TEMPLATE.md
vendored
Normal file
@ -0,0 +1,7 @@
|
||||
<!--- Thank you for contributing to Laradock -->
|
||||
|
||||
##### I completed the 3 steps below:
|
||||
|
||||
- [] I've read the [Contribution Guide](http://laradock.io/contributing).
|
||||
- [] I've updated the **documentation**. (refer to [this](http://laradock.io/contributing/#update-the-documentation-site) for how to do so).
|
||||
- [] I enjoyed my time contributing and making developer's life easier :)
|
481
README-zh.md → .github/README-zh.md
vendored
@ -1,24 +1,23 @@
|
||||
# LaraDock
|
||||
# Laradock
|
||||
|
||||
[](http://zalt.me)
|
||||
|
||||
[](https://gitter.im/LaraDock/laradock?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
|
||||
[](https://gitter.im/Laradock/laradock?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
|
||||
|
||||
LaraDock能够帮你在**Docker**上快速搭建**Laravel**应用。
|
||||
<br>
|
||||
就像Laravel Homestead一样,但是Docker替换了Vagrant。
|
||||
> 先在使用 LaraDock,然后再学习它们。
|
||||
Laradock 能够帮你在 **Docker** 上快速搭建 **Laravel** 应用。
|
||||
|
||||
就像 Laravel Homestead 一样,但是 Docker 替换了 Vagrant。
|
||||
|
||||
> 先在使用 Laradock,然后再学习它们。
|
||||
|
||||
<br>
|
||||
## 目录
|
||||
|
||||
- [Intro](#Intro)
|
||||
- [Features](#features)
|
||||
- [Supported Software's](#Supported-Containers)
|
||||
- [What is Docker](#what-is-docker)
|
||||
- [What is Laravel](#what-is-laravel)
|
||||
- [Why Docker not Vagrant](#why-docker-not-vagrant)
|
||||
- [LaraDock VS Homestead](#laradock-vs-homestead)
|
||||
- [Laradock VS Homestead](#laradock-vs-homestead)
|
||||
- [Demo Video](#Demo)
|
||||
- [Requirements](#Requirements)
|
||||
- [Installation](#Installation)
|
||||
@ -50,44 +49,51 @@ LaraDock能够帮你在**Docker**上快速搭建**Laravel**应用。
|
||||
- [Install Prestissimo](#Install-Prestissimo)
|
||||
- [Install Node + NVM](#Install-Node)
|
||||
- [Debugging](#debugging)
|
||||
- [Upgrading LaraDock](#upgrading-laradock)
|
||||
- [Upgrading Laradock](#upgrading-laradock)
|
||||
- [Help & Questions](#Help)
|
||||
|
||||
|
||||
|
||||
<a name="Intro"></a>
|
||||
## 介绍
|
||||
LaraDock努力简化创建开发环境过程。
|
||||
它包含预包装Docker镜像,提供你一个美妙的开发环境而不需要安装PHP,NGINX,MySQL和其他任何软件在你本地机器上。
|
||||
|
||||
Laradock 努力简化创建开发环境过程。
|
||||
它包含预包装 Docker 镜像,提供你一个美妙的开发环境而不需要安装 PHP, NGINX, MySQL 和其他任何软件在你本地机器上。
|
||||
|
||||
**使用概览:**
|
||||
|
||||
让我们了解使用它安装 `NGINX`, `PHP`, `Composer`, `MySQL` 和 `Redis`,然后运行 `Laravel`
|
||||
|
||||
让我们了解使用它安装`NGINX`, `PHP`, `Composer`, `MySQL` 和 `Redis`,然后运行`Laravel`
|
||||
1. 将 Laradock 放到你的 Laravel 项目中:
|
||||
```bash
|
||||
git clone https://github.com/laradock/laradock.git
|
||||
```
|
||||
|
||||
1. 将LaraDock放到你的Laravel项目中:
|
||||
<br>
|
||||
`git clone https://github.com/laradock/laradock.git`.
|
||||
2. 进入LaraDock目录,然后运行这些容器。
|
||||
<br>
|
||||
`docker-compose up -d nginx mysql redis`
|
||||
3. 打开你的`.env`文件,然后设置`mysql`的`DB_HOST` 和 `redis`的`REDIS_HOST`。
|
||||
4. 打开浏览器,访问localhost:
|
||||
2. 进入 Laradock 目录
|
||||
```bash
|
||||
cp env-example .env
|
||||
```
|
||||
|
||||
3. 运行这些容器。
|
||||
```bash
|
||||
docker-compose up -d nginx mysql redis
|
||||
```
|
||||
|
||||
4. 打开你的Laravel 项目的 `.env` 文件,然后设置 `mysql` 的 `DB_HOST` 和 `redis` 的`REDIS_HOST`。
|
||||
|
||||
5. 打开浏览器,访问 localhost:
|
||||
|
||||
<a name="features"></a>
|
||||
### 特点
|
||||
|
||||
- 在PHP版本:7.0,5.6.5.5...之中可以简单切换。
|
||||
- 在 PHP 版本:7.0,5.6.5.5...之中可以简单切换。
|
||||
- 可选择你最喜欢的数据库引擎,比如:MySQL, Postgres, MariaDB...
|
||||
- 可运行自己的软件组合,比如:Memcached, HHVM, Beanstalkd...
|
||||
- 所有软件运行在不同的容器之中,比如:PHP-FPM, NGINX, PHP-CLI...
|
||||
- 通过简单的编写`dockerfile`容易定制任何容器。
|
||||
- 通过简单的编写 `Dockerfile` 容易定制任何容器。
|
||||
- 所有镜像继承自一个官方基础镜像(Trusted base Images)
|
||||
- 可预配置Laravel的Nginx环境
|
||||
- 容易应用容器中的配置
|
||||
- 干净的结构化的Docker配置文件(`dockerfile`)
|
||||
- 最新的Docker Compose 版本(`docker-compose`)
|
||||
- 容易应用容器中的配置 配置文件(`Dockerfile`)
|
||||
- 最新的 Docker Compose 版本(`docker-compose`)
|
||||
- 所有的都是可视化和可编辑的
|
||||
- 快速的镜像构建
|
||||
- 每周都会有更新...
|
||||
@ -115,96 +121,82 @@ LaraDock努力简化创建开发环境过程。
|
||||
- Beanstalkd (+ Beanstalkd Console)
|
||||
- **工具:**
|
||||
- Workspace (PHP7-CLI, Composer, Git, Node, Gulp, SQLite, Vim, Nano, cURL...)
|
||||
|
||||
>如果你找不到你需要的软件,构建它然后把它添加到这个列表。你的贡献是受欢迎的。
|
||||
|
||||
<a name="what-is-docker"></a>
|
||||
### Docker是什么?
|
||||
### Docker 是什么?
|
||||
|
||||
[Docker](https://www.docker.com) 是一个开源项目,自动化部署应用程序软件的容器,在Linux, Mac OS and Windows提供一个额外的抽象层和自动化的[操作系统级的虚拟化](https://en.wikipedia.org/wiki/Operating-system-level_virtualization)
|
||||
[Docker](https://www.docker.com) 是一个开源项目,自动化部署应用程序软件的容器,在 Linux, Mac OS and Windows 提供一个额外的抽象层和自动化的[操作系统级的虚拟化](https://en.wikipedia.org/wiki/Operating-system-level_virtualization)
|
||||
|
||||
<a name="what-is-laravel"></a>
|
||||
### Laravel是什么?
|
||||
### Laravel 是什么?
|
||||
|
||||
额,这很认真的!!!
|
||||
|
||||
|
||||
<a name="why-docker-not-vagrant"></a>
|
||||
### 为什么使用Docker而不是Vagrant!?
|
||||
### 为什么使用 Docker 而不是 Vagrant!?
|
||||
|
||||
[Vagrant](https://www.vagrantup.com)构建虚拟机需要几分钟然而Docker构建虚拟容器只需要几秒钟。
|
||||
而不是提供一个完整的虚拟机,就像你用Vagrant,Docker为您提供**轻量级**虚拟容器,共享相同的内核和允许安全执行独立的进程。
|
||||
[Vagrant](https://www.vagrantup.com) 构建虚拟机需要几分钟然而 Docker 构建虚拟容器只需要几秒钟。
|
||||
而不是提供一个完整的虚拟机,就像你用 Vagrant, Docker 为您提供**轻量级**虚拟容器,共享相同的内核和允许安全执行独立的进程。
|
||||
|
||||
除了速度,Docker提供大量的Vagrant无法实现的功能。
|
||||
除了速度, Docker 提供大量的 Vagrant 无法实现的功能。
|
||||
|
||||
最重要的是Docker可以运行在开发和生产(相同环境无处不在)。Vagrant是专为开发,(所以在生产环境你必须每一次重建您的服务器)。
|
||||
最重要的是 Docker 可以运行在开发和生产(相同环境无处不在)。Vagrant 是专为开发,(所以在生产环境你必须每一次重建您的服务器)。
|
||||
|
||||
<a name="laradock-vs-homestead"></a>
|
||||
### LaraDock Homestead 对比
|
||||
### Laradock Homestead 对比
|
||||
|
||||
LaraDock and [Homestead](https://laravel.com/docs/master/homestead) 给你一个完整的虚拟开发环境。(不需要安装和配置软件在你自己的每一个操作系统)。
|
||||
|
||||
Homestead 是一个工具,为你控制虚拟机(使用Homestead特殊命令)。Vagrant可以管理你的管理虚容器。
|
||||
|
||||
运行一个虚拟容器比运行一整个虚拟机快多了**LaraDock 比 Homestead快多了**
|
||||
Laradock and [Homestead](https://laravel.com/docs/master/homestead) 给你一个完整的虚拟开发环境。(不需要安装和配置软件在你自己的每一个操作系统)。
|
||||
|
||||
Homestead 是一个工具,为你控制虚拟机(使用 Homestead 特殊命令)。Vagrant 可以管理你的管理虚容器。
|
||||
|
||||
运行一个虚拟容器比运行一整个虚拟机快多了 **Laradock 比 Homestead 快多了**
|
||||
|
||||
<a name="Demo"></a>
|
||||
## 演示视频
|
||||
还有什么比**演示视频**好:
|
||||
|
||||
- LaraDock [v4.0](https://www.youtube.com/watch?v=TQii1jDa96Y)
|
||||
- LaraDock [v2.2](https://www.youtube.com/watch?v=-DamFMczwDA)
|
||||
- LaraDock [v0.3](https://www.youtube.com/watch?v=jGkyO6Is_aI)
|
||||
- LaraDock [v0.1](https://www.youtube.com/watch?v=3YQsHe6oF80)
|
||||
|
||||
|
||||
- Laradock [v4.0](https://www.youtube.com/watch?v=TQii1jDa96Y)
|
||||
- Laradock [v2.2](https://www.youtube.com/watch?v=-DamFMczwDA)
|
||||
- Laradock [v0.3](https://www.youtube.com/watch?v=jGkyO6Is_aI)
|
||||
- Laradock [v0.1](https://www.youtube.com/watch?v=3YQsHe6oF80)
|
||||
|
||||
<a name="Requirements"></a>
|
||||
## 依赖
|
||||
|
||||
- [Git](https://git-scm.com/downloads)
|
||||
- [Git](https://git-scm.com/downloads)
|
||||
- [Docker](https://www.docker.com/products/docker/)
|
||||
|
||||
|
||||
|
||||
<a name="Installation"></a>
|
||||
## 安装
|
||||
|
||||
1 - 克隆 `Laradock` 仓库:
|
||||
|
||||
1 - 克隆 `LaraDock` 仓库:
|
||||
|
||||
**A)** 如果你已经有一个Laravel项目,克隆这个仓库在到`Laravel`根目录
|
||||
**A)** 如果你已经有一个 Laravel 项目,克隆这个仓库在到 `Laravel` 根目录
|
||||
|
||||
```bash
|
||||
git submodule add https://github.com/laradock/laradock.git
|
||||
```
|
||||
>如果你不是使用Git管理Laravel项目,您可以使用 `git clone` 而不是`git submodule`。
|
||||
|
||||
>如果你不是使用 Git 管理 Laravel 项目,您可以使用 `git clone` 而不是 `git submodule`。
|
||||
|
||||
**B)** 如果你没有一个Laravel项目,你想Docker安装Laravel,克隆这个源在您的机器任何地方上:
|
||||
**B)** 如果你没有一个 Laravel 项目,你想 Docker 安装 Laravel,克隆这个源在您的机器任何地方上:
|
||||
|
||||
```bash
|
||||
git clone https://github.com/laradock/laradock.git
|
||||
```
|
||||
|
||||
|
||||
|
||||
<a name="Usage"></a>
|
||||
## 使用
|
||||
|
||||
|
||||
**请在开始之前阅读:**
|
||||
如果你正在使用**Docker Toolbox** (VM),选择以下任何一个方法:
|
||||
- 更新到Docker [Native](https://www.docker.com/products/docker) Mac/Windows版本 (建议). 查看 [Upgrading LaraDock](#upgrading-laradock)
|
||||
- 使用 LaraDock v3.* (访问 `LaraDock-ToolBox` [分支](https://github.com/laradock/laradock/tree/LaraDock-ToolBox)).
|
||||
如果您使用的是**Docker Native**(Mac / Windows版本)甚至是Linux版本,通常可以继续阅读这个文档,LaraDock v4以上版本将仅支持**Docker Native**。
|
||||
|
||||
<br>
|
||||
<br>
|
||||
1 - 运行容器: *(在运行`docker-compose`命令之前,确认你在 `laradock` 目录中*
|
||||
|
||||
如果你正在使用 **Docker Toolbox** (VM),选择以下任何一个方法:
|
||||
- 更新到 Docker [Native](https://www.docker.com/products/docker) Mac/Windows 版本 (建议). 查看 [Upgrading Laradock](#upgrading-laradock)
|
||||
- 使用 Laradock v3.* (访问 `Laradock-ToolBox` [分支](https://github.com/laradock/laradock/tree/Laradock-ToolBox)).
|
||||
如果您使用的是 **Docker Native**(Mac / Windows 版本)甚至是 Linux 版本,通常可以继续阅读这个文档,Laradock v4 以上版本将仅支持 **Docker Native**。
|
||||
|
||||
1 - 运行容器: *(在运行 `docker-compose` 命令之前,确认你在 `laradock` 目录中*
|
||||
|
||||
**例子:** 运行 NGINX 和 MySQL:
|
||||
|
||||
@ -213,77 +205,50 @@ docker-compose up -d nginx mysql
|
||||
```
|
||||
你可以从以下列表选择你自己的容器组合:
|
||||
|
||||
|
||||
`nginx`, `hhvm`, `php-fpm`, `mysql`, `redis`, `postgres`, `mariadb`, `neo4j`, `mongo`, `apache2`, `caddy`, `memcached`, `beanstalkd`, `beanstalkd-console`, `workspace`.
|
||||
|
||||
|
||||
**说明**: `workspace` 和 `php-fpm` 将运行在大部分实例中, 所以不需要在 `up` 命令中加上它们.
|
||||
|
||||
|
||||
|
||||
<br>
|
||||
2 - 进入 Workspace 容器, 执行像 (Artisan, Composer, PHPUnit, Gulp, ...)等命令
|
||||
|
||||
```bash
|
||||
docker-compose exec workspace bash
|
||||
```
|
||||
<br />
|
||||
|
||||
增加 `--user=laradock` (例如 `docker-compose exec --user=laradock workspace bash`) 作为您的主机的用户创建的文件. (你可以从 `docker-compose.yml`修改 PUID (User id) 和 PGID (group id) 值 ).
|
||||
|
||||
|
||||
|
||||
<br>
|
||||
3 - 编辑 Laravel 的配置.
|
||||
|
||||
如果你还没有安装Laravel项目,请查看 [How to Install Laravel in a Docker Container](#Install-Laravel).
|
||||
如果你还没有安装 Laravel 项目,请查看 [How to Install Laravel in a Docker Container](#Install-Laravel).
|
||||
|
||||
打开 Laravel的 `.env` 文件 然后 配置 你的`mysql`的`DB_HOST`:
|
||||
打开 Laravel 的 `.env` 文件 然后 配置 你的 `mysql` 的 `DB_HOST`:
|
||||
|
||||
```env
|
||||
DB_HOST=mysql
|
||||
```
|
||||
|
||||
4 - 打开浏览器访问 localhost (`http://localhost/`).
|
||||
|
||||
|
||||
|
||||
|
||||
<br>
|
||||
4 - 打开浏览器访问localhost (`http://localhost/`).
|
||||
|
||||
|
||||
|
||||
<br>
|
||||
**调试**: 如果你碰到任何问题,请查看 [调试](#debugging) 章节
|
||||
如果你需要特别支持,请联系我,更多细节在[帮助 & 问题](#Help)章节
|
||||
|
||||
|
||||
<br>
|
||||
<a name="Documentation"></a>
|
||||
## 文档
|
||||
|
||||
|
||||
<a name="Docker"></a>
|
||||
### [Docker]
|
||||
|
||||
|
||||
|
||||
<a name="List-current-running-Containers"></a>
|
||||
### 列出正在运行的容器
|
||||
```bash
|
||||
docker ps
|
||||
```
|
||||
|
||||
你也可以使用以下命令查看某项目的容器
|
||||
|
||||
|
||||
```bash
|
||||
docker-compose ps
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<br>
|
||||
<a name="Close-all-running-Containers"></a>
|
||||
### 关闭所有容器
|
||||
```bash
|
||||
@ -296,25 +261,18 @@ docker-compose stop
|
||||
docker-compose stop {容器名称}
|
||||
```
|
||||
|
||||
<br>
|
||||
<a name="Delete-all-existing-Containers"></a>
|
||||
### 删除所有容器
|
||||
```bash
|
||||
docker-compose down
|
||||
```
|
||||
|
||||
|
||||
小心这个命令,因为它也会删除你的数据容器。(如果你想保留你的数据你应该在上述命令后列出容器名称删除每个容器本身):*
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<br>
|
||||
<a name="Enter-Container"></a>
|
||||
### 进入容器 (通过SSH 进入一个运行中的容器)
|
||||
### 进入容器 (通过 SSH 进入一个运行中的容器)
|
||||
|
||||
1 - 首先使用 `docker ps`命令查看正在运行的容器
|
||||
1 - 首先使用 `docker ps` 命令查看正在运行的容器
|
||||
|
||||
2 - 进入某个容器使用:
|
||||
|
||||
@ -331,12 +289,6 @@ docker-compose exec mysql bash
|
||||
3 - 退出容器, 键入 `exit`.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<br>
|
||||
<a name="Edit-Container"></a>
|
||||
### 编辑默认容器配置
|
||||
打开 `docker-compose.yml` 然后 按照你想的修改.
|
||||
@ -357,18 +309,10 @@ docker-compose exec mysql bash
|
||||
- "1111:6379"
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<br>
|
||||
<a name="Edit-a-Docker-Image"></a>
|
||||
### 编辑Docker镜像
|
||||
### 编辑 Docker 镜像
|
||||
|
||||
1 - 找到你想修改的镜像的 `dockerfile` ,
|
||||
1 - 找到你想修改的镜像的 `Dockerfile` ,
|
||||
<br>
|
||||
例如: `mysql` 在 `mysql/Dockerfile`.
|
||||
|
||||
@ -379,28 +323,19 @@ docker-compose exec mysql bash
|
||||
```bash
|
||||
docker-compose build mysql
|
||||
```
|
||||
更多信息在容器重建中 [点击这里](#Build-Re-build-Containers).
|
||||
|
||||
更多信息在容器重建中[点击这里](#Build-Re-build-Containers).
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<br>
|
||||
<a name="Build-Re-build-Containers"></a>
|
||||
### 建立/重建容器
|
||||
|
||||
|
||||
如果你做任何改变`dockerfile`确保你运行这个命令,可以让所有修改更改生效:
|
||||
|
||||
如果你做任何改变 `Dockerfile` 确保你运行这个命令,可以让所有修改更改生效:
|
||||
|
||||
```bash
|
||||
docker-compose build
|
||||
```
|
||||
选择你可以指定哪个容器重建(而不是重建所有的容器):
|
||||
|
||||
选择你可以指定哪个容器重建(而不是重建所有的容器):
|
||||
|
||||
```bash
|
||||
docker-compose build {container-name}
|
||||
@ -408,25 +343,11 @@ docker-compose build {container-name}
|
||||
|
||||
如果你想重建整个容器,你可能需要使用 `--no-cache` 选项 (`docker-compose build --no-cache {container-name}`).
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<br>
|
||||
<a name="Add-Docker-Images"></a>
|
||||
### 增加更多软件 (Docker 镜像)
|
||||
|
||||
为了增加镜像(软件), 编辑 `docker-compose.yml` 添加容器细节, 你需要熟悉 [docker compose 文件语法](https://docs.docker.com/compose/compose-file/).
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<br>
|
||||
<a name="View-the-Log-files"></a>
|
||||
### 查看日志文件
|
||||
Nginx的日志在 `logs/nginx` 目录
|
||||
@ -437,19 +358,12 @@ Nginx的日志在 `logs/nginx` 目录
|
||||
docker logs {container-name}
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<br>
|
||||
<a name="Laravel"></a>
|
||||
### [Laravel]
|
||||
|
||||
|
||||
|
||||
|
||||
<a name="Install-Laravel"></a>
|
||||
### 从Docker镜像安装Laravel
|
||||
### 从 Docker 镜像安装 Laravel
|
||||
|
||||
1 - 首先你需要进入 Workspace 容器.
|
||||
|
||||
2 - 安装 Laravel.
|
||||
@ -460,16 +374,15 @@ docker logs {container-name}
|
||||
composer create-project laravel/laravel my-cool-app "5.2.*"
|
||||
```
|
||||
|
||||
> 我们建议使用 `composer create-project` 替换Laravel 安装器去安装Laravel.
|
||||
> 我们建议使用 `composer create-project` 替换 Laravel 安装器去安装 Laravel.
|
||||
|
||||
关于更多Laravel安装内容请 [点击这儿](https://laravel.com/docs/master#installing-laravel).
|
||||
关于更多 Laravel 安装内容请 [点击这儿](https://laravel.com/docs/master#installing-laravel).
|
||||
|
||||
|
||||
3 - 编辑 `docker-compose.yml` 映射新的应用目录:
|
||||
系统默认LaraDock假定Laravel应用在LaraDock的父级目录中
|
||||
By default LaraDock assumes the Laravel application is living in the parent directory of the laradock folder.
|
||||
系统默认 Laradock 假定 Laravel 应用在 laradock 的父级目录中
|
||||
|
||||
更新Laravel应用在 `my-cool-app` 目录中, 我们需要用 `../my-cool-app/:/var/www`替换 `../:/var/www` , 如下:
|
||||
更新 Laravel 应用在 `my-cool-app` 目录中, 我们需要用 `../my-cool-app/:/var/www`替换 `../:/var/www` , 如下:
|
||||
|
||||
```yaml
|
||||
application:
|
||||
@ -477,32 +390,33 @@ By default LaraDock assumes the Laravel application is living in the parent dire
|
||||
volumes:
|
||||
- ../my-cool-app/:/var/www
|
||||
```
|
||||
|
||||
4 - 进入目录下继续工作..
|
||||
|
||||
```bash
|
||||
cd my-cool-app
|
||||
```
|
||||
|
||||
5 - 回到LaraDock安装步骤,看看如何编辑`env`的文件。
|
||||
5 - 回到 Laradock 安装步骤,看看如何编辑 `.env` 的文件。
|
||||
|
||||
<br>
|
||||
<a name="Run-Artisan-Commands"></a>
|
||||
### 运行 Artisan 命令
|
||||
你可以从Workspace容器运行artisan命令和其他终端命令
|
||||
|
||||
1 - 确认Workspace容器已经运行.
|
||||
你可以从 Workspace 容器运行 artisan 命令和其他终端命令
|
||||
|
||||
1 - 确认 Workspace 容器已经运行.
|
||||
|
||||
```bash
|
||||
docker-compose up -d workspace // ..and all your other containers
|
||||
```
|
||||
|
||||
2 - 找到Workspace容器名称:
|
||||
2 - 找到 Workspace 容器名称:
|
||||
|
||||
```bash
|
||||
docker-compose ps
|
||||
```
|
||||
|
||||
3 - 进入Workspace容器:
|
||||
3 - 进入 Workspace 容器:
|
||||
|
||||
```bash
|
||||
docker-compose exec workspace bash
|
||||
@ -510,35 +424,33 @@ docker-compose exec workspace bash
|
||||
|
||||
增加 `--user=laradock` (例如 `docker-compose exec --user=laradock workspace bash`) 作为您的主机的用户创建的文件.
|
||||
|
||||
|
||||
4 - 运行任何你想的 :)
|
||||
|
||||
```bash
|
||||
php artisan
|
||||
```
|
||||
```bash
|
||||
Composer update
|
||||
composer update
|
||||
```
|
||||
```bash
|
||||
phpunit
|
||||
```
|
||||
|
||||
<br>
|
||||
<a name="Use-Redis"></a>
|
||||
### 使用 Redis
|
||||
1 - 首先务必用 `docker-compose up` 命令运行 (`redis`)容器.
|
||||
|
||||
1 - 首先务必用 `docker-compose up` 命令运行 (`redis`) 容器.
|
||||
|
||||
```bash
|
||||
docker-compose up -d redis
|
||||
```
|
||||
|
||||
2 - 打开你的Laravel的 `.env` 文件 然后 配置`redis`的`REDIS_HOST`
|
||||
2 - 打开你的Laravel的 `.env` 文件 然后 配置 `redis` 的 `REDIS_HOST`
|
||||
|
||||
```env
|
||||
REDIS_HOST=redis
|
||||
```
|
||||
如果在你的`.env` 文件没有找到`REDIS_HOST`变量。打开数据库配置文件`config/database.php`然后用`redis`替换默认IP`127.0.0.1`,例如:
|
||||
|
||||
如果在你的 `.env` 文件没有找到 `REDIS_HOST` 变量。打开数据库配置文件 `config/database.php` 然后用 `redis` 替换默认 IP `127.0.0.1`,例如:
|
||||
|
||||
|
||||
```php
|
||||
@ -552,44 +464,35 @@ REDIS_HOST=redis
|
||||
],
|
||||
```
|
||||
|
||||
3 - 启用Redis缓存或者开启Session管理也在`.env`文件中用`redis`替换默认`file`设置`CACHE_DRIVER` 和 `SESSION_DRIVER`
|
||||
3 - 启用 Redis 缓存或者开启 Session 管理也在 `.env` 文件中用 `redis` 替换默认 `file` 设置 `CACHE_DRIVER` 和 `SESSION_DRIVER`
|
||||
|
||||
```env
|
||||
CACHE_DRIVER=redis
|
||||
SESSION_DRIVER=redis
|
||||
```
|
||||
|
||||
4 - 最好务必通过Compose安装 `predis/predis` 包 `(~1.0)`:
|
||||
4 - 最好务必通过 Composer 安装 `predis/predis` 包 `(~1.0)`:
|
||||
|
||||
```bash
|
||||
composer require predis/predis:^1.0
|
||||
```
|
||||
|
||||
5 - 你可以用以下代码在Laravel中手动测试:
|
||||
5 - 你可以用以下代码在 Laravel 中手动测试:
|
||||
|
||||
```php
|
||||
\Cache::store('redis')->put('LaraDock', 'Awesome', 10);
|
||||
\Cache::store('redis')->put('Laradock', 'Awesome', 10);
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<br>
|
||||
<a name="Use-Mongo"></a>
|
||||
### 使用 Mongo
|
||||
|
||||
1 - 首先在Workspace和PHP-FPM容器中安装`mongo`:
|
||||
<br>
|
||||
a) 打开 `docker-compose.yml` 文件
|
||||
<br>
|
||||
b) 在Workspace容器中找到`INSTALL_MONGO`选项:
|
||||
1 - 首先在 Workspace 和 PHP-FPM 容器中安装 `mongo`:
|
||||
|
||||
<br>
|
||||
c) 设置为 `true`
|
||||
<br>
|
||||
d) 在PHP-FPM容器中找到`INSTALL_MONGO` <br>
|
||||
e) 设置为 `true`
|
||||
a) 打开 `docker-compose.yml` 文件
|
||||
b) 在 Workspace 容器中找到 `INSTALL_MONGO` 选项:
|
||||
c) 设置为 `true`
|
||||
d) 在 PHP-FPM 容器中找到 `INSTALL_MONGO`
|
||||
e) 设置为 `true`
|
||||
|
||||
相关配置项如下:
|
||||
|
||||
@ -608,18 +511,19 @@ e) 设置为 `true`
|
||||
...
|
||||
```
|
||||
|
||||
2 - 重建`Workspace、PHP-FPM`容器 `docker-compose build workspace php-fpm`
|
||||
2 - 重建 `Workspace、PHP-FPM` 容器
|
||||
|
||||
```bash
|
||||
docker-compose build workspace php-fpm
|
||||
```
|
||||
|
||||
|
||||
3 - 使用`docker-compose up` 命令运行MongoDB容器 (`mongo`)
|
||||
3 - 使用 `docker-compose up` 命令运行 MongoDB 容器 (`mongo`)
|
||||
|
||||
```bash
|
||||
docker-compose up -d mongo
|
||||
```
|
||||
|
||||
|
||||
4 - 在`config/database.php` 文件添加MongoDB的配置项:
|
||||
4 - 在 `config/database.php` 文件添加 MongoDB 的配置项:
|
||||
|
||||
```php
|
||||
'connections' => [
|
||||
@ -641,65 +545,53 @@ docker-compose up -d mongo
|
||||
],
|
||||
```
|
||||
|
||||
5 - 打开Laravel的 `.env` 文件 然后 更新以下字段:
|
||||
5 - 打开 Laravel 的 `.env` 文件然后更新以下字段:
|
||||
|
||||
- 设置 `DB_HOST` 为 `mongo`的主机IP.
|
||||
- 设置 `DB_HOST` 为 `mongo` 的主机 IP.
|
||||
- 设置 `DB_PORT` 为 `27017`.
|
||||
- 设置 `DB_DATABASE` 为 `database`.
|
||||
|
||||
|
||||
6 - 最后务必通过Composer安装`jenssegers/mongodb`包,添加服务提供者(Laravel Service Provider)
|
||||
6 - 最后务必通过 Composer 安装 `jenssegers/mongodb` 包,添加服务提供者(Laravel Service Provider)
|
||||
|
||||
|
||||
```bash
|
||||
composer require jenssegers/mongodb
|
||||
```
|
||||
|
||||
更多细节内容 [点击这儿](https://github.com/jenssegers/laravel-mongodb#installation).
|
||||
|
||||
7 - 测试:
|
||||
|
||||
- 首先让你的模型继承Mongo的Eloquent Model. 查看 [文档](https://github.com/jenssegers/laravel-mongodb#eloquent).
|
||||
- 进入Workspace容器.
|
||||
- 首先让你的模型继承 Mongo 的 Eloquent Model. 查看 [文档](https://github.com/jenssegers/laravel-mongodb#eloquent).
|
||||
- 进入 Workspace 容器.
|
||||
- 迁移数据库 `php artisan migrate`.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<br>
|
||||
<a name="PHP"></a>
|
||||
### [PHP]
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a name="Install-PHP-Extensions"></a>
|
||||
### 安装PHP拓展
|
||||
安装PHP扩展之前,你必须决定你是否需要`FPM`或`CLI`,因为他们安装在不同的容器上,如果你需要两者,则必须编辑两个容器。
|
||||
### 安装 PHP 拓展
|
||||
|
||||
PHP-FPM拓展务必安装在 `php-fpm/Dockerfile-XX`. *(用你PHP版本号替换 XX)*.
|
||||
<br>
|
||||
PHP-CLI拓展应该安装到`workspace/Dockerfile`.
|
||||
安装 PHP 扩展之前,你必须决定你是否需要 `FPM` 或 `CLI`,因为他们安装在不同的容器上,如果你需要两者,则必须编辑两个容器。
|
||||
|
||||
PHP-FPM 拓展务必安装在 `php-fpm/Dockerfile-XX`. *(用你 PHP 版本号替换 XX)*.
|
||||
|
||||
PHP-CLI 拓展应该安装到 `workspace/Dockerfile`.
|
||||
|
||||
<br>
|
||||
<a name="Change-the-PHP-FPM-Version"></a>
|
||||
### 修改PHP-FPM版本
|
||||
默认运行**PHP-FPM 7.0**版本.
|
||||
|
||||
>PHP-FPM负责服务你的应用代码,如果你是计划运行您的应用程序在不同PHP-FPM版本上,则不需要更改PHP-CLI版本。
|
||||
### 修改 PHP-FPM 版本
|
||||
默认运行 **PHP-FPM 7.0** 版本.
|
||||
|
||||
>PHP-FPM 负责服务你的应用代码,如果你是计划运行您的应用程序在不同 PHP-FPM 版本上,则不需要更改 PHP-CLI 版本。
|
||||
|
||||
#### A) 切换版本 PHP `7.0` 到 PHP `5.6`
|
||||
|
||||
1 - 打开 `docker-compose.yml`。
|
||||
|
||||
2 - 在PHP容器的 `Dockerfile-70`文件。
|
||||
2 - 在PHP容器的 `Dockerfile-70` 文件。
|
||||
|
||||
3 - 修改版本号, 用`Dockerfile-56`替换 `Dockerfile-70` , 例如:
|
||||
3 - 修改版本号, 用 `Dockerfile-56` 替换 `Dockerfile-70` , 例如:
|
||||
|
||||
```txt
|
||||
php-fpm:
|
||||
@ -718,57 +610,39 @@ docker-compose build php
|
||||
|
||||
|
||||
#### B) 切换版本 PHP `7.0` 或 `5.6` 到 PHP `5.5`
|
||||
我们已不在本地支持PHP5.5,但是你按照以下步骤获取:
|
||||
我们已不在本地支持 PHP5.5,但是你按照以下步骤获取:
|
||||
|
||||
1 - 克隆 `https://github.com/laradock/php-fpm`.
|
||||
|
||||
3 - 重命名 `Dockerfile-56` 为 `Dockerfile-55`.
|
||||
2 - 重命名 `Dockerfile-56` 为 `Dockerfile-55`.
|
||||
|
||||
3 - 编辑文件 `FROM php:5.6-fpm` 为 `FROM php:5.5-fpm`.
|
||||
|
||||
4 - 从 `Dockerfile-55`构建镜像.
|
||||
4 - 从 `Dockerfile-55` 构建镜像.
|
||||
|
||||
5 - 打开 `docker-compose.yml` 文件.
|
||||
|
||||
6 - 将 `php-fpm` 指向你的 `Dockerfile-55` 文件.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<br>
|
||||
<a name="Change-the-PHP-CLI-Version"></a>
|
||||
### 修改 PHP-CLI 版本
|
||||
默认运行**PHP-CLI 7.0**版本
|
||||
默认运行 **PHP-CLI 7.0** 版本
|
||||
|
||||
>说明: PHP-CLI只用于执行Artisan和Composer命令,不服务于你的应用代码,这是PHP-FPM的工作,所以编辑PHP-CLI的版本不是很重要。
|
||||
PHP-CLI安装在Workspace容器,改变PHP-CLI版本你需要编辑`workspace/Dockerfile`.
|
||||
现在你必须手动修改PHP-FPM的`Dockerfile`或者创建一个新的。 (可以考虑贡献功能).
|
||||
>说明: PHP-CLI 只用于执行 Artisan 和 Composer 命令,不服务于你的应用代码,这是 PHP-FPM 的工作,所以编辑 PHP-CLI 的版本不是很重要。
|
||||
PHP-CLI 安装在 Workspace 容器,改变 PHP-CLI 版本你需要编辑 `workspace/Dockerfile`.
|
||||
现在你必须手动修改 PHP-FPM 的 `Dockerfile` 或者创建一个新的。 (可以考虑贡献功能).
|
||||
|
||||
|
||||
|
||||
|
||||
<br>
|
||||
<a name="Install-xDebug"></a>
|
||||
### 安装 xDebug
|
||||
|
||||
1 - 首先在Workspace和PHP-FPM容器安装 `xDebug`:
|
||||
<br>
|
||||
a) 打开 `docker-compose.yml` 文件
|
||||
<br>
|
||||
b) 在Workspace容器中找到 `INSTALL_XDEBUG` 选项
|
||||
<br>
|
||||
c) 改为 `true`
|
||||
<br>
|
||||
d) 在PHP-FPM容器中找到 `INSTALL_XDEBUG ` 选项<br>
|
||||
e) 改为 `true`
|
||||
1 - 首先在 Workspace 和 PHP-FPM 容器安装 `xDebug`:
|
||||
|
||||
a) 打开 `docker-compose.yml` 文件
|
||||
b) 在 Workspace 容器中找到 `INSTALL_XDEBUG` 选项
|
||||
c) 改为 `true`
|
||||
d) 在 PHP-FPM 容器中找到 `INSTALL_XDEBUG ` 选项
|
||||
e) 改为 `true`
|
||||
|
||||
例如:
|
||||
|
||||
@ -789,44 +663,35 @@ e) 改为 `true`
|
||||
|
||||
2 - 重建容器 `docker-compose build workspace php-fpm`
|
||||
|
||||
|
||||
|
||||
<br>
|
||||
<a name="Misc"></a>
|
||||
### [Misc]
|
||||
|
||||
|
||||
<br>
|
||||
<a name="Use-custom-Domain"></a>
|
||||
### 使用自定义域名 (替换Docker的IP)
|
||||
### 使用自定义域名 (替换 Docker 的 IP)
|
||||
|
||||
假定你的自定义域名是 `laravel.dev`
|
||||
|
||||
1 - 打开 `/etc/hosts` 文件 添加以下内容,映射你的localhost 地址 `127.0.0.1` 为 `laravel.dev` 域名
|
||||
1 - 打开 `/etc/hosts` 文件添加以下内容,映射你的 localhost 地址 `127.0.0.1` 为 `laravel.dev` 域名
|
||||
```bash
|
||||
127.0.0.1 laravel.dev
|
||||
```
|
||||
|
||||
2 - 打开你的浏览器访问 `{http://laravel.dev}`
|
||||
|
||||
你可以在nginx配置文件自定义服务器名称,如下:
|
||||
|
||||
你可以在 nginx 配置文件自定义服务器名称,如下:
|
||||
|
||||
```conf
|
||||
server_name laravel.dev;
|
||||
```
|
||||
|
||||
|
||||
|
||||
<br>
|
||||
<a name="Enable-Global-Composer-Build-Install"></a>
|
||||
### 安装全局Composer命令
|
||||
### 安装全局 Composer 命令
|
||||
|
||||
为启用全局Composer Install在容器构建中允许你安装composer的依赖,然后构建完成后就是可用的。
|
||||
为启用全局 Composer Install 在容器构建中允许你安装 composer 的依赖,然后构建完成后就是可用的。
|
||||
|
||||
1 - 打开 `docker-compose.yml` 文件
|
||||
|
||||
2 - 在Workspace容器找到 `COMPOSER_GLOBAL_INSTALL` 选项并设置为 `true`
|
||||
2 - 在 Workspace 容器找到 `COMPOSER_GLOBAL_INSTALL` 选项并设置为 `true`
|
||||
|
||||
例如:
|
||||
|
||||
@ -840,19 +705,16 @@ server_name laravel.dev;
|
||||
```
|
||||
3 - 现在特价你的依赖关系到 `workspace/composer.json`
|
||||
|
||||
4 - 重建Workspace容器 `docker-compose build workspace`
|
||||
4 - 重建 Workspace 容器 `docker-compose build workspace`
|
||||
|
||||
|
||||
|
||||
|
||||
<br>
|
||||
<a name="Install-Prestissimo"></a>
|
||||
### 安装 Prestissimo
|
||||
|
||||
[Prestissimo](https://github.com/hirak/prestissimo) 是一个平行安装功能的composer插件。
|
||||
1 - 在安装期间,使全局Composer Install 正在运行:
|
||||
[Prestissimo](https://github.com/hirak/prestissimo) 是一个平行安装功能的 composer 插件。
|
||||
|
||||
点击这个 [启用全局Composer构建安装](#Enable-Global-Composer-Build-Install) 然后继续步骤1、2.
|
||||
1 - 在安装期间,使全局 Composer Install 正在运行:
|
||||
|
||||
点击这个 [启用全局 Composer 构建安装](#Enable-Global-Composer-Build-Install) 然后继续步骤1、2.
|
||||
|
||||
2 - 添加 prestissimo 依赖到 Composer:
|
||||
|
||||
@ -860,19 +722,17 @@ a - 现在打开 `workspace/composer.json` 文件
|
||||
|
||||
b - 添加 `"hirak/prestissimo": "^0.3"` 依赖
|
||||
|
||||
c - 重建Workspace容器 `docker-compose build workspace`
|
||||
c - 重建 Workspace 容器 `docker-compose build workspace`
|
||||
|
||||
|
||||
|
||||
|
||||
<br>
|
||||
<a name="Install-Node"></a>
|
||||
### 安装 Node + NVM
|
||||
|
||||
在Workspace 容器安装 NVM 和 NodeJS
|
||||
在 Workspace 容器安装 NVM 和 NodeJS
|
||||
|
||||
1 - 打开 `docker-compose.yml` 文件
|
||||
|
||||
2 - 在Workspace容器找到 `INSTALL_NODE` 选项设为 `true`
|
||||
2 - 在 Workspace 容器找到 `INSTALL_NODE` 选项设为 `true`
|
||||
|
||||
例如:
|
||||
|
||||
@ -887,17 +747,14 @@ c - 重建Workspace容器 `docker-compose build workspace`
|
||||
|
||||
3 - 重建容器 `docker-compose build workspace`
|
||||
|
||||
|
||||
|
||||
<br>
|
||||
<a name="debugging"></a>
|
||||
### Debugging
|
||||
|
||||
*这里是你可能面临的常见问题列表,以及可能的解决方案.*
|
||||
|
||||
#### 看到空白页而不是Laravel的欢迎页面!
|
||||
#### 看到空白页而不是 Laravel 的欢迎页面!
|
||||
|
||||
在Laravel根目录,运行下列命令:
|
||||
在 Laravel 根目录,运行下列命令:
|
||||
|
||||
```bash
|
||||
sudo chmod -R 777 storage bootstrap/cache
|
||||
@ -909,45 +766,39 @@ sudo chmod -R 777 storage bootstrap/cache
|
||||
|
||||
#### 看到包含 `address already in use` 的错误
|
||||
|
||||
确保你想运行的服务端口(80, 3306, etc.)不是已经被其他程序使用,例如`apache`/`httpd`服务或其他安装的开发工具
|
||||
确保你想运行的服务端口(80, 3306, etc.)不是已经被其他程序使用,例如 `apache`/`httpd` 服务或其他安装的开发工具
|
||||
|
||||
|
||||
<br>
|
||||
<a name="upgrading-laradock"></a>
|
||||
### LaraDock 升级
|
||||
### Laradock 升级
|
||||
|
||||
|
||||
从Docker Toolbox (VirtualBox)移动到Docker Native (for Mac/Windows),需要从 LaraDock v3.* 升级到 v4.*:
|
||||
从 Docker Toolbox (VirtualBox) 移动到 Docker Native (for Mac/Windows),需要从 Laradock v3.* 升级到 v4.*:
|
||||
|
||||
1. 停止Docker虚拟机 `docker-machine stop {default}`
|
||||
1. 停止 Docker 虚拟机 `docker-machine stop {default}`
|
||||
2. 安装 Docker [Mac](https://docs.docker.com/docker-for-mac/) 或 [Windows](https://docs.docker.com/docker-for-windows/).
|
||||
3. 升级 LaraDock 到 `v4.*.*` (`git pull origin master`)
|
||||
4. 像之前一样使用LaraDock: `docker-compose up -d nginx mysql`.
|
||||
3. 升级 Laradock 到 `v4.*.*` (`git pull origin master`)
|
||||
4. 像之前一样使用 Laradock: `docker-compose up -d nginx mysql`.
|
||||
|
||||
**说明:** 如果你面临任何上面的问题的最后一步:重建你所有的容器
|
||||
`docker-compose build --no-cache`
|
||||
```bash
|
||||
docker-compose build --no-cache
|
||||
```
|
||||
"警告:容器数据可能会丢失!"
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<br>
|
||||
## 贡献
|
||||
这个小项目是由一个有一个全职工作和很多的职责的人建立的,所以如果你喜欢这个项目,并且发现它需要一个bug修复或支持或新软件或升级任何容器,或其他任何. . 你是非常欢迎,欢迎毫不不犹豫地贡献吧:)
|
||||
这个小项目是由一个有一个全职工作和很多的职责的人建立的,所以如果你喜欢这个项目,并且发现它需要一个 bug 修复或支持或新软件或升级任何容器,或其他任何. . 你是非常欢迎,欢迎毫不不犹豫地贡献吧:)
|
||||
|
||||
#### 阅读我们的 [贡献说明](https://github.com/laradock/laradock/blob/master/CONTRIBUTING.md)
|
||||
|
||||
<a name="Help"></a>
|
||||
## 帮助 & 问题
|
||||
|
||||
从聊天室 [Gitter](https://gitter.im/LaraDock/laradock) 社区获取帮助和支持.
|
||||
从聊天室 [Gitter](https://gitter.im/Laradock/laradock) 社区获取帮助和支持.
|
||||
|
||||
你也可以打开Github上的 [issue](https://github.com/laradock/laradock/issues) (将被贴上问题和答案) 或与大家讨论 [Gitter](https://gitter.im/LaraDock/laradock).
|
||||
你也可以打开 Github 上的 [issue](https://github.com/laradock/laradock/issues) (将被贴上问题和答案) 或与大家讨论 [Gitter](https://gitter.im/Laradock/laradock).
|
||||
|
||||
Docker或Laravel的特别帮助,你可以在[Codementor.io](https://www.codementor.io/mahmoudz)上直接和项目创始人在线沟通
|
||||
Docker 或 Laravel 的特别帮助,你可以在 [Codementor.io](https://www.codementor.io/mahmoudz) 上直接和项目创始人在线沟通
|
||||
|
||||
## 关于作者
|
||||
|
49
.github/README.md
vendored
Normal file
@ -0,0 +1,49 @@
|
||||
<p align="center">
|
||||
<img src="https://s19.postimg.org/jblfytw9f/laradock-logo.jpg" alt="Laradock Logo"/>
|
||||
</p>
|
||||
|
||||
<p align="center">A Docker PHP development environment that facilitates running PHP Apps on Docker</p>
|
||||
|
||||
<p align="center">
|
||||
<a href="https://travis-ci.org/laradock/laradock"><img src="https://travis-ci.org/laradock/laradock.svg?branch=master" alt="Build status"></a>
|
||||
<a href="https://github.com/laradock/laradock/stargazers"><img src="https://img.shields.io/github/stars/laradock/laradock.svg" alt="GitHub stars"></a>
|
||||
<a href="https://github.com/laradock/laradock/network"><img src="https://img.shields.io/github/forks/laradock/laradock.svg" alt="GitHub forks"></a>
|
||||
<a href="https://github.com/laradock/laradock/issues"><img src="https://img.shields.io/github/issues/laradock/laradock.svg" alt="GitHub issues"></a>
|
||||
<a href="https://raw.githubusercontent.com/laradock/laradock/master/LICENSE"><img src="https://img.shields.io/badge/license-MIT-blue.svg" alt="GitHub license"></a>
|
||||
<a href="http://laradock.io/contributing"><img src="https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat" alt="contributions welcome"></a>
|
||||
</p>
|
||||
|
||||
<h4 align="center" style="color:#7d58c2">Use Docker First And Learn About It Later</h4>
|
||||
|
||||
<p align="center">
|
||||
<a href="https://zalt.me"><img src="http://forthebadge.com/images/badges/built-by-developers.svg" alt="forthebadge" width="240" ></a>
|
||||
</p>
|
||||
|
||||
|
||||
---
|
||||
|
||||
<p align="center">
|
||||
<a href="http://laradock.io">
|
||||
<img src="https://s19.postimg.org/ecnn9vdw3/Screen_Shot_2017-08-01_at_5.08.54_AM.png" width=300px" alt="Laradock Docs"/>
|
||||
</a>
|
||||
</p>
|
||||
|
||||
|
||||
## Credits
|
||||
|
||||
- [Mahmoud Zalt](https://github.com/Mahmoudz) @mahmoudz | [Twitter](https://twitter.com/Mahmoud_Zalt) | [Site](http://zalt.me)
|
||||
- [Bo-Yi Wu](https://github.com/appleboy) @appleboy | [Twitter](https://twitter.com/appleboy)
|
||||
- [Philippe Trépanier](https://github.com/philtrep) @philtrep
|
||||
- [Mike Erickson](https://github.com/mikeerickson) @mikeerickson
|
||||
- [Dwi Fahni Denni](https://github.com/zeroc0d3) @zeroc0d3
|
||||
- [Thor Erik](https://github.com/thorerik) @thorerik
|
||||
- [Winfried van Loon](https://github.com/winfried-van-loon) @winfried-van-loon
|
||||
- [TJ Miller](https://github.com/sixlive) @sixlive
|
||||
- [Yu-Lung Shao (Allen)](https://github.com/bestlong) @bestlong
|
||||
- [Milan Urukalo](https://github.com/urukalo) @urukalo
|
||||
- [Vince Chu](https://github.com/vwchu) @vwchu
|
||||
- Join Us.
|
||||
|
||||
## License
|
||||
|
||||
[MIT License](https://github.com/laradock/laradock/blob/master/LICENSE)
|
3
.gitignore
vendored
@ -1,3 +1,6 @@
|
||||
.idea
|
||||
/logs
|
||||
/data
|
||||
.env
|
||||
/.project
|
||||
.docker-sync
|
62
.travis.yml
Normal file
@ -0,0 +1,62 @@
|
||||
language: bash
|
||||
sudo: required
|
||||
services:
|
||||
- docker
|
||||
|
||||
env:
|
||||
matrix:
|
||||
- PHP_VERSION=56 BUILD_SERVICE="applications blackfire minio percona nginx caddy apache2 mysql mariadb phpmyadmin postgres postgres-postgis pgadmin neo4j mongo redis"
|
||||
- PHP_VERSION=70 BUILD_SERVICE="applications blackfire minio percona nginx caddy apache2 mysql mariadb phpmyadmin postgres postgres-postgis pgadmin neo4j mongo redis"
|
||||
- PHP_VERSION=71 BUILD_SERVICE="applications blackfire minio percona nginx caddy apache2 mysql mariadb phpmyadmin postgres postgres-postgis pgadmin neo4j mongo redis"
|
||||
|
||||
- PHP_VERSION=56 BUILD_SERVICE=workspace
|
||||
- PHP_VERSION=70 BUILD_SERVICE=workspace
|
||||
- PHP_VERSION=71 BUILD_SERVICE=workspace
|
||||
|
||||
- PHP_VERSION=56 BUILD_SERVICE=php-fpm
|
||||
- PHP_VERSION=70 BUILD_SERVICE=php-fpm
|
||||
- PHP_VERSION=71 BUILD_SERVICE=php-fpm
|
||||
|
||||
- PHP_VERSION=56 BUILD_SERVICE="php-worker hhvm"
|
||||
- PHP_VERSION=70 BUILD_SERVICE="php-worker hhvm"
|
||||
- PHP_VERSION=71 BUILD_SERVICE="php-worker hhvm"
|
||||
|
||||
- PHP_VERSION=56 BUILD_SERVICE=mssql
|
||||
- PHP_VERSION=70 BUILD_SERVICE=mssql
|
||||
- PHP_VERSION=71 BUILD_SERVICE=mssql
|
||||
|
||||
- PHP_VERSION=56 BUILD_SERVICE=rethinkdb
|
||||
- PHP_VERSION=70 BUILD_SERVICE=rethinkdb
|
||||
- PHP_VERSION=71 BUILD_SERVICE=rethinkdb
|
||||
|
||||
- PHP_VERSION=56 BUILD_SERVICE=aerospike
|
||||
- PHP_VERSION=70 BUILD_SERVICE=aerospike
|
||||
- PHP_VERSION=71 BUILD_SERVICE=aerospike
|
||||
|
||||
- PHP_VERSION=56 BUILD_SERVICE="memcached beanstalkd beanstalkd-console rabbitmq adminer elasticsearch certbot mailhog selenium jenkins proxy proxy2 balancer"
|
||||
- PHP_VERSION=70 BUILD_SERVICE="memcached beanstalkd beanstalkd-console rabbitmq adminer elasticsearch certbot mailhog selenium jenkins proxy proxy2 balancer"
|
||||
- PHP_VERSION=71 BUILD_SERVICE="memcached beanstalkd beanstalkd-console rabbitmq adminer elasticsearch certbot mailhog selenium jenkins proxy proxy2 balancer"
|
||||
|
||||
- HUGO_VERSION=0.20.2
|
||||
|
||||
# Installing a newer Docker version
|
||||
before_install:
|
||||
- curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
|
||||
- sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
|
||||
- sudo apt-get update
|
||||
- sudo apt-get -y install docker-ce
|
||||
- docker version
|
||||
|
||||
script: ./travis-build.sh
|
||||
|
||||
deploy:
|
||||
provider: pages
|
||||
skip_cleanup: true
|
||||
local_dir: docs
|
||||
github_token: $GITHUB_TOKEN
|
||||
on:
|
||||
branch: master
|
||||
condition: -n "${HUGO_VERSION}"
|
||||
|
||||
notifications:
|
||||
email: false
|
@ -1,25 +1,26 @@
|
||||
baseurl = "http://laradock.io/"
|
||||
languageCode = "en-us"
|
||||
publishDir = "../"
|
||||
title = "Laradock Docs"
|
||||
publishDir = "../docs"
|
||||
title = "Laradock"
|
||||
theme = "hugo-material-docs"
|
||||
metadataformat = "yaml"
|
||||
canonifyurls = true
|
||||
uglyurls = true
|
||||
# Enable Google Analytics by entering your tracking id
|
||||
googleAnalytics = "UA-37514928-9"
|
||||
|
||||
[params]
|
||||
# General information
|
||||
author = "Mahmoud Zalt"
|
||||
description = "Laradock documentations."
|
||||
description = "Full PHP development environment for Docker."
|
||||
copyright = ""
|
||||
|
||||
# Repository
|
||||
provider = "GitHub"
|
||||
repo_url = "https://github.com/laradock/laradock"
|
||||
provider = ""
|
||||
repo_url = ""
|
||||
|
||||
version = ""
|
||||
logo = ""
|
||||
logo = "images/logo.png"
|
||||
favicon = ""
|
||||
|
||||
permalink = "#"
|
||||
@ -32,8 +33,8 @@ googleAnalytics = "UA-37514928-9"
|
||||
highlight_css = ""
|
||||
|
||||
[params.palette]
|
||||
primary = "purple"
|
||||
accent = "deep-purple"
|
||||
primary = "deep-purple"
|
||||
accent = "purple"
|
||||
|
||||
[params.font]
|
||||
text = "Doctarine"
|
||||
@ -41,7 +42,7 @@ googleAnalytics = "UA-37514928-9"
|
||||
|
||||
[social]
|
||||
twitter = ""
|
||||
github = "laradock"
|
||||
github = "laradock/laradock"
|
||||
email = ""
|
||||
|
||||
# ------- MENU START -----------------------------------------
|
||||
@ -62,8 +63,8 @@ googleAnalytics = "UA-37514928-9"
|
||||
weight = 3
|
||||
|
||||
[[menu.main]]
|
||||
name = "Related Projects"
|
||||
url = "related-projects/"
|
||||
name = "Guides"
|
||||
url = "guides/"
|
||||
weight = 4
|
||||
|
||||
[[menu.main]]
|
||||
@ -71,15 +72,20 @@ googleAnalytics = "UA-37514928-9"
|
||||
url = "help/"
|
||||
weight = 5
|
||||
|
||||
[[menu.main]]
|
||||
name = "Related Projects"
|
||||
url = "related-projects/"
|
||||
weight = 6
|
||||
|
||||
[[menu.main]]
|
||||
name = "Contributing"
|
||||
url = "contributing/"
|
||||
weight = 6
|
||||
weight = 7
|
||||
|
||||
[[menu.main]]
|
||||
name = "License"
|
||||
url = "license/"
|
||||
weight = 7
|
||||
weight = 8
|
||||
|
||||
# ------- MENU END -----------------------------------------
|
||||
|
207
DOCUMENTATION/content/contributing/index.md
Normal file
@ -0,0 +1,207 @@
|
||||
---
|
||||
title: Contributing
|
||||
type: index
|
||||
weight: 7
|
||||
---
|
||||
|
||||
|
||||
## Have a Question
|
||||
|
||||
If you have questions about how to use Laradock, please direct your questions to the discussion on [Gitter](https://gitter.im/Laradock/laradock). If you believe your question could help others, then consider opening an [Issue](https://github.com/laradock/laradock/issues) (it will be labeled as `Question`) And you can still seek help on Gitter for it.
|
||||
|
||||
|
||||
|
||||
## Found an Issue
|
||||
|
||||
If have an issue or you found a typo in the documentation, you can help us by
|
||||
opnening an [Issue](https://github.com/laradock/laradock/issues).
|
||||
|
||||
**Steps to do before opening an Issue:**
|
||||
|
||||
1. Before you submit your issue search the archive, maybe your question was already answered couple hours ago (search in the closed Issues as well).
|
||||
|
||||
2. Decide if the Issue belongs to this project or to [Docker](https://github.com/docker) itself! or even the tool you are using such as Nginx or MongoDB...
|
||||
|
||||
If your issue appears to be a bug, and hasn't been reported, then open a new issue.
|
||||
|
||||
*This Help us to maximize the effort we can spend fixing issues and adding new
|
||||
features, by not reporting duplicate issues.*
|
||||
|
||||
|
||||
|
||||
## Want a Feature
|
||||
You can request a new feature by submitting an [Issue](https://github.com/laradock/laradock/issues) (it will be labeled as `Feature Suggestion`). If you would like to implement a new feature then consider submitting a Pull Request yourself.
|
||||
|
||||
|
||||
|
||||
|
||||
## Update the Documentation (Site)
|
||||
|
||||
Laradock uses [Hugo](https://gohugo.io/) as website generator tool, with the [Material Docs theme](http://themes.gohugo.io/theme/material-docs/). You might need to check their docs quickly.
|
||||
|
||||
Go the `DOCUMENTATION/content` and search for the markdown file you want to edit
|
||||
|
||||
Note: Every folder represents a section in the sidebar "Menu". And every page and sidebar has a `weight` number to show it's position in the site.
|
||||
|
||||
To update the sidebar or add a new section to it, you can edit this `DOCUMENTATION/config.toml` toml file.
|
||||
|
||||
> The site will be auto-generated in the `docs/` folder by [Travis CI](https://travis-ci.org/laradock/laradock/).
|
||||
|
||||
|
||||
|
||||
### Host the documentation locally
|
||||
|
||||
1. Install [Hugo](https://gohugo.io/) on your machine.
|
||||
2. Edit the `DOCUMENTATION/content`.
|
||||
3. Delete the `/docs` folder from the root.
|
||||
4. After you finish the editing, go to `DOCUMENTATION/` and run the `hugo` command to generate the HTML docs (inside a new `/docs` folder).
|
||||
|
||||
|
||||
|
||||
|
||||
## Support new Software (Add new Container)
|
||||
|
||||
* Forke the repo and clone the code.
|
||||
|
||||
* Create folder as the software name (example: `mysql` - `nginx`).
|
||||
|
||||
* Add your `Dockerfile` in the folder "you may add additional files as well".
|
||||
|
||||
* Add the software to the `docker-compose.yml` file.
|
||||
|
||||
* Make sure you follow the same code/comments style.
|
||||
|
||||
* Add the environment variables to the `env-example` if you have any.
|
||||
|
||||
* **MOST IMPORTANTLY** updated the `Documentation`, add as much information.
|
||||
|
||||
* Submit a Pull Request, to the `master` branch.
|
||||
|
||||
|
||||
|
||||
## Edit supported Software (Edit a Container)
|
||||
|
||||
* Forke the repo and clone the code.
|
||||
|
||||
* Open the software (container) folder (example: `mysql` - `nginx`).
|
||||
|
||||
* Edit the files.
|
||||
|
||||
* Make sure to update the `Documentation` in case you made any changes.
|
||||
|
||||
* Submit a Pull Request, to the `master` branch.
|
||||
|
||||
|
||||
|
||||
|
||||
## Edit Base Image
|
||||
|
||||
* Open any dockerfile, copy the base image name (example: `FROM phusion/baseimage:latest`).
|
||||
|
||||
* Search for the image in the [Docker Hub](https://hub.docker.com/search/) and find the source..
|
||||
|
||||
*Most of the image in Laradock are offical images, these projects live in other repositories and maintainer by other orgnizations.*
|
||||
|
||||
**Note:** Laradock has two base images for (`Workspace` and `php-fpm`, mainly made to speed up the build time on your machine.
|
||||
|
||||
* Find the dockerfiles, edit them and submit a Pull Request.
|
||||
|
||||
* When updating a Laradock base image (`Workspace` or `php-fpm`), ask a project maintainer "Admin" to build a new image after your PR is merged.
|
||||
|
||||
**Note:** after the base image is updated, every dockerfile that uses that image, needs to update his base image tag to get the updated code.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<br>
|
||||
|
||||
|
||||
|
||||
|
||||
## Submit Pull Request Instructions
|
||||
|
||||
### 1. Before Submitting a Pull Request (PR)
|
||||
|
||||
Always Test everything and make sure its working:
|
||||
|
||||
- Pull the latest updates (or fork of you don’t have permission)
|
||||
- Before editing anything:
|
||||
- Test building the container (docker-compose build --no-cache container-name) build with no cache first.
|
||||
- Test running the container with some other containers in real app and see of everything is working fine.
|
||||
- Now edit the container (edit section by section and test rebuilding the container after every edited section)
|
||||
- Testing building the container (docker-compose build container-name) with no errors.
|
||||
- Test it in a real App if possible.
|
||||
|
||||
|
||||
### 2. Submitting a PR
|
||||
Consider the following guidelines:
|
||||
|
||||
* Search [GitHub](https://github.com/laradock/laradock/pulls) for an open or closed Pull Request that relates to your submission. You don't want to duplicate efforts.
|
||||
|
||||
* Make your changes in a new git branch:
|
||||
|
||||
```shell
|
||||
git checkout -b my-fix-branch master
|
||||
```
|
||||
* Commit your changes using a descriptive commit message.
|
||||
|
||||
* Push your branch to GitHub:
|
||||
|
||||
```shell
|
||||
git push origin my-fix-branch
|
||||
```
|
||||
|
||||
* In GitHub, send a pull request to `laradock:master`.
|
||||
* If we suggest changes then:
|
||||
* Make the required updates.
|
||||
* Commit your changes to your branch (e.g. `my-fix-branch`).
|
||||
* Push the changes to your GitHub repository (this will update your Pull Request).
|
||||
|
||||
> If the PR gets too outdated we may ask you to rebase and force push to update the PR:
|
||||
|
||||
```shell
|
||||
git rebase master -i
|
||||
git push origin my-fix-branch -f
|
||||
```
|
||||
|
||||
*WARNING. Squashing or reverting commits and forced push thereafter may remove GitHub comments on code that were previously made by you and others in your commits.*
|
||||
|
||||
|
||||
### 3. After your PR is merged
|
||||
|
||||
After your pull request is merged, you can safely delete your branch and pull the changes from the main (upstream) repository:
|
||||
|
||||
* Delete the remote branch on GitHub either through the GitHub web UI or your local shell as follows:
|
||||
|
||||
```shell
|
||||
git push origin --delete my-fix-branch
|
||||
```
|
||||
|
||||
* Check out the master branch:
|
||||
|
||||
```shell
|
||||
git checkout master -f
|
||||
```
|
||||
|
||||
* Delete the local branch:
|
||||
|
||||
```shell
|
||||
git branch -D my-fix-branch
|
||||
```
|
||||
|
||||
* Update your master with the latest upstream version:
|
||||
|
||||
```shell
|
||||
git pull --ff upstream master
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<br>
|
||||
#### Happy Coding :)
|
@ -5,6 +5,8 @@ weight: 3
|
||||
---
|
||||
|
||||
|
||||
|
||||
|
||||
<a name="List-current-running-Containers"></a>
|
||||
## List current running Containers
|
||||
```bash
|
||||
@ -153,7 +155,6 @@ You might use the `--no-cache` option if you want full rebuilding (`docker-compo
|
||||
|
||||
|
||||
|
||||
|
||||
<br>
|
||||
<a name="Add-Docker-Images"></a>
|
||||
## Add more Software (Docker Images)
|
||||
@ -173,9 +174,17 @@ The NGINX Log file is stored in the `logs/nginx` directory.
|
||||
However to view the logs of all the other containers (MySQL, PHP-FPM,...) you can run this:
|
||||
|
||||
```bash
|
||||
docker logs {container-name}
|
||||
docker-compose logs {container-name}
|
||||
```
|
||||
|
||||
```bash
|
||||
docker-compose logs -f {container-name}
|
||||
```
|
||||
|
||||
More [options](https://docs.docker.com/compose/reference/logs/)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -223,7 +232,7 @@ By default **PHP-FPM 7.0** is running.
|
||||
php-fpm:
|
||||
build:
|
||||
context: ./php-fpm
|
||||
dockerfile: Dockerfile-70
|
||||
dockerfile: Dockerfile-56
|
||||
...
|
||||
```
|
||||
|
||||
@ -306,9 +315,7 @@ It should be like this:
|
||||
...
|
||||
```
|
||||
|
||||
2 - Re-build the containers `docker-compose build workspace php-fpm`
|
||||
|
||||
3 - Open `laradock/workspace/xdebug.ini` and/or `laradock/php-fpm/xdebug.ini` and enable at least the following configurations:
|
||||
2 - Open `laradock/workspace/xdebug.ini` and `laradock/php-fpm/xdebug.ini` and enable at least the following configurations:
|
||||
|
||||
```
|
||||
xdebug.remote_autostart=1
|
||||
@ -316,11 +323,25 @@ xdebug.remote_enable=1
|
||||
xdebug.remote_connect_back=1
|
||||
```
|
||||
|
||||
For information on how to configure xDebug with your IDE and work it out, check this [Repository](https://github.com/LarryEitel/laravel-laradock-phpstorm).
|
||||
3 - Re-build the containers `docker-compose build workspace php-fpm`
|
||||
|
||||
For information on how to configure xDebug with your IDE and work it out, check this [Repository](https://github.com/LarryEitel/laravel-laradock-phpstorm) or follow up on the next section if you use linux and PhpStorm.
|
||||
|
||||
|
||||
<a name="Setup remote debugging for PhpStorm on Linux"></a>
|
||||
## Setup remote debugging for PhpStorm on Linux
|
||||
|
||||
- Make sure you have followed the steps above in the [Install Xdebug section](http://laradock.io/documentation/#install-xdebug).
|
||||
|
||||
- Make sure Xdebug accepts connections and listens on port 9000. (Should be default configuration).
|
||||
|
||||
.
|
||||
|
||||
- Create a server with name `laradock` (matches **PHP_IDE_CONFIG** key in environment file) and make sure to map project root path with server correctly.
|
||||
|
||||
.
|
||||
|
||||
- Start listening for debug connections, place a breakpoint and you are good to go !
|
||||
|
||||
|
||||
<br>
|
||||
@ -329,13 +350,13 @@ For information on how to configure xDebug with your IDE and work it out, check
|
||||
|
||||
By installing xDebug, you are enabling it to run on startup by default.
|
||||
|
||||
To control the behavior of xDebug (in the `php-fpm` Container), you can run the following commands from the LaraDock root folder, (at the same prompt where you run docker-compose):
|
||||
To control the behavior of xDebug (in the `php-fpm` Container), you can run the following commands from the Laradock root folder, (at the same prompt where you run docker-compose):
|
||||
|
||||
- Stop xDebug from running by default: `./xdebugPhpFpm stop`.
|
||||
- Start xDebug by default: `./xdebugPhpFpm start`.
|
||||
- See the status: `./xdebugPhpFpm status`.
|
||||
- Stop xDebug from running by default: `.php-fpm/xdebug stop`.
|
||||
- Start xDebug by default: `.php-fpm/xdebug start`.
|
||||
- See the status: `.php-fpm/xdebug status`.
|
||||
|
||||
Note: If `./xdebugPhpFpm` doesn't execute and gives `Permission Denied` error the problem can be that file `xdebugPhpFpm` doesn't have execution access. This can be fixed by running `chmod` command with desired access permissions.
|
||||
Note: If `.php-fpm/xdebug` doesn't execute and gives `Permission Denied` error the problem can be that file `xdebug` doesn't have execution access. This can be fixed by running `chmod` command with desired access permissions.
|
||||
|
||||
|
||||
|
||||
@ -381,10 +402,10 @@ It should be like this:
|
||||
|
||||
|
||||
<br>
|
||||
<a name="LaraDock-for-Production"></a>
|
||||
## Prepare LaraDock for Production
|
||||
<a name="Laradock-for-Production"></a>
|
||||
## Prepare Laradock for Production
|
||||
|
||||
It's recommended for production to create a custom `docker-compose.yml` file. For that reason, LaraDock is shipped with `production-docker-compose.yml` which should contain only the containers you are planning to run on production (usage example: `docker-compose -f production-docker-compose.yml up -d nginx mysql redis ...`).
|
||||
It's recommended for production to create a custom `docker-compose.yml` file. For that reason, Laradock is shipped with `production-docker-compose.yml` which should contain only the containers you are planning to run on production (usage example: `docker-compose -f production-docker-compose.yml up -d nginx mysql redis ...`).
|
||||
|
||||
Note: The Database (MySQL/MariaDB/...) ports should not be forwarded on production, because Docker will automatically publish the port on the host, which is quite insecure, unless specifically told not to. So make sure to remove these lines:
|
||||
|
||||
@ -439,7 +460,7 @@ For more about the Laravel installation click [here](https://laravel.com/docs/ma
|
||||
|
||||
3 - Edit `docker-compose.yml` to Map the new application path:
|
||||
|
||||
By default, LaraDock assumes the Laravel application is living in the parent directory of the laradock folder.
|
||||
By default, Laradock assumes the Laravel application is living in the parent directory of the laradock folder.
|
||||
|
||||
Since the new Laravel application is in the `my-cool-app` folder, we need to replace `../:/var/www` with `../my-cool-app/:/var/www`, as follow:
|
||||
|
||||
@ -456,7 +477,7 @@ Since the new Laravel application is in the `my-cool-app` folder, we need to rep
|
||||
cd my-cool-app
|
||||
```
|
||||
|
||||
5 - Go back to the LaraDock installation steps to see how to edit the `.env` file.
|
||||
5 - Go back to the Laradock installation steps to see how to edit the `.env` file.
|
||||
|
||||
|
||||
|
||||
@ -581,7 +602,7 @@ composer require predis/predis:^1.0
|
||||
5 - You can manually test it from Laravel with this code:
|
||||
|
||||
```php
|
||||
\Cache::store('redis')->put('LaraDock', 'Awesome', 10);
|
||||
\Cache::store('redis')->put('Laradock', 'Awesome', 10);
|
||||
```
|
||||
|
||||
|
||||
@ -694,6 +715,8 @@ docker-compose up -d mysql phpmyadmin
|
||||
docker-compose up -d mariadb phpmyadmin
|
||||
```
|
||||
|
||||
*Note: To use with MariaDB, open `.env` and set `PMA_DB_ENGINE=mysql` to `PMA_DB_ENGINE=mariadb`.*
|
||||
|
||||
2 - Open your browser and visit the localhost on port **8080**: `http://localhost:8080`
|
||||
|
||||
|
||||
@ -701,6 +724,24 @@ docker-compose up -d mariadb phpmyadmin
|
||||
|
||||
|
||||
|
||||
<br>
|
||||
<a name="Use-Adminer"></a>
|
||||
## Use Adminer
|
||||
|
||||
1 - Run the Adminer Container (`adminer`) with the `docker-compose up` command. Example:
|
||||
|
||||
```bash
|
||||
docker-compose up -d adminer
|
||||
```
|
||||
|
||||
2 - Open your browser and visit the localhost on port **8080**: `http://localhost:8080`
|
||||
|
||||
**Note:** We've locked Adminer to version 4.3.0 as at the time of writing [it contained a major bug](https://sourceforge.net/p/adminer/bugs-and-features/548/) preventing PostgreSQL users from logging in. If that bug is fixed (or if you're not using PostgreSQL) feel free to set Adminer to the latest version within [the Dockerfile](https://github.com/laradock/laradock/blob/master/adminer/Dockerfile#L1): `FROM adminer:latest`
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<br>
|
||||
<a name="Use-pgAdmin"></a>
|
||||
## Use PgAdmin
|
||||
@ -881,6 +922,26 @@ docker-compose up -d minio
|
||||
```
|
||||
|
||||
|
||||
|
||||
<br>
|
||||
<a name="Use-AWS"></a>
|
||||
## Use AWS
|
||||
|
||||
1 - Configure AWS:
|
||||
- make sure to add your SSH keys in aws/ssh_keys folder
|
||||
|
||||
2 - Run the Aws Container (`aws`) with the `docker-compose up` command. Example:
|
||||
|
||||
```bash
|
||||
docker-compose up -d aws
|
||||
```
|
||||
|
||||
3 - Access the aws container with `docker-compose exec aws bash`
|
||||
|
||||
4 - To start using eb cli inside the container, initiaze your project first by doing 'eb init'. Read the [aws eb cli](http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/eb-cli3-configuration.html) docs for more details.
|
||||
|
||||
|
||||
|
||||
<br>
|
||||
<a name="CodeIgniter"></a>
|
||||
|
||||
@ -893,7 +954,7 @@ docker-compose up -d minio
|
||||
<a name="Install-CodeIgniter"></a>
|
||||
## Install CodeIgniter
|
||||
|
||||
To install CodeIgniter 3 on LaraDock all you have to do is the following simple steps:
|
||||
To install CodeIgniter 3 on Laradock all you have to do is the following simple steps:
|
||||
|
||||
1 - Open the `docker-compose.yml` file.
|
||||
|
||||
@ -902,9 +963,18 @@ To install CodeIgniter 3 on LaraDock all you have to do is the following simple
|
||||
3 - Re-build your PHP-FPM Container `docker-compose build php-fpm`.
|
||||
|
||||
|
||||
<a name="Install-Symfony"></a>
|
||||
## Install Symfony
|
||||
|
||||
1 - Open the `.env` file and set `WORKSPACE_INSTALL_SYMFONY` to `true`.
|
||||
|
||||
2 - Run `docker-compose build workspace`, after the step above.
|
||||
|
||||
3 - The NGINX sites include a default config file for your Symfony project `symfony.conf.example`, so edit it and make sure the `root` is pointing to your project `web` directory.
|
||||
|
||||
4 - Run `docker-compose restart` if the container was already running, before the step above.
|
||||
|
||||
5 - Visit `symfony.dev`
|
||||
|
||||
<br>
|
||||
<a name="Misc"></a>
|
||||
@ -979,6 +1049,26 @@ To change the default forwarded port for ssh:
|
||||
|
||||
|
||||
|
||||
<br>
|
||||
<a name="Change-the-MySQL-Version"></a>
|
||||
## Change the (MySQL) Version
|
||||
By default **MySQL 8.0** is running.
|
||||
|
||||
MySQL 8.0 is a development release. You may prefer to use the latest stable version, or an even older release. If you wish, you can change the MySQL image that is used.
|
||||
|
||||
Open up your .env file and set the `MYSQL_VERSION` variable to the version you would like to install.
|
||||
|
||||
```
|
||||
MYSQL_VERSION=5.7
|
||||
```
|
||||
|
||||
Available versions are: 5.5, 5.6, 5.7, 8.0, or latest. See https://store.docker.com/images/mysql for more information.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<br>
|
||||
<a name="MySQL-access-from-host"></a>
|
||||
## MySQL access from host
|
||||
@ -1013,6 +1103,19 @@ The default username and password for the root MySQL user are `root` and `root `
|
||||
|
||||
|
||||
|
||||
<br>
|
||||
<a name="Create-Multiple-Databases"></a>
|
||||
## Create Multiple Databases (MySQL)
|
||||
|
||||
Create `createdb.sql` from `mysql/docker-entrypoint-initdb.d/createdb.sql.example` in `mysql/docker-entrypoint-initdb.d/*` and add your SQL syntax as follow:
|
||||
|
||||
```sql
|
||||
CREATE DATABASE IF NOT EXISTS `your_db_1` COLLATE 'utf8_general_ci' ;
|
||||
GRANT ALL ON `your_db_1`.* TO 'mysql_user'@'%' ;
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
<br>
|
||||
<a name="Change-MySQL-port"></a>
|
||||
@ -1198,7 +1301,7 @@ It should be like this:
|
||||
<a name="Common-Aliases"></a>
|
||||
<br>
|
||||
## Common Terminal Aliases
|
||||
When you start your docker container, LaraDock will copy the `aliases.sh` file located in the `laradock/workspace` directory and add sourcing to the container `~/.bashrc` file.
|
||||
When you start your docker container, Laradock will copy the `aliases.sh` file located in the `laradock/workspace` directory and add sourcing to the container `~/.bashrc` file.
|
||||
|
||||
You are free to modify the `aliases.sh` as you see fit, adding your own aliases (or function macros) to suit your requirements.
|
||||
|
||||
@ -1214,11 +1317,11 @@ You are free to modify the `aliases.sh` as you see fit, adding your own aliases
|
||||
<br>
|
||||
a) open the `docker-compose.yml` file
|
||||
<br>
|
||||
b) search for the `INSTALL_AEROSPIKE_EXTENSION` argument under the Workspace Container
|
||||
b) search for the `INSTALL_AEROSPIKE` argument under the Workspace Container
|
||||
<br>
|
||||
c) set it to `true`
|
||||
<br>
|
||||
d) search for the `INSTALL_AEROSPIKE_EXTENSION` argument under the PHP-FPM Container
|
||||
d) search for the `INSTALL_AEROSPIKE` argument under the PHP-FPM Container
|
||||
<br>
|
||||
e) set it to `true`
|
||||
|
||||
@ -1229,13 +1332,13 @@ It should be like this:
|
||||
build:
|
||||
context: ./workspace
|
||||
args:
|
||||
- INSTALL_AEROSPIKE_EXTENSION=true
|
||||
- INSTALL_AEROSPIKE=true
|
||||
...
|
||||
php-fpm:
|
||||
build:
|
||||
context: ./php-fpm
|
||||
args:
|
||||
- INSTALL_AEROSPIKE_EXTENSION=true
|
||||
- INSTALL_AEROSPIKE=true
|
||||
...
|
||||
```
|
||||
|
||||
@ -1292,10 +1395,10 @@ Remote debug Laravel web and phpunit tests.
|
||||
|
||||
|
||||
<br>
|
||||
<a name="keep-tracking-LaraDock"></a>
|
||||
## Keep track of your LaraDock changes
|
||||
<a name="keep-tracking-Laradock"></a>
|
||||
## Keep track of your Laradock changes
|
||||
|
||||
1. Fork the LaraDock repository.
|
||||
1. Fork the Laradock repository.
|
||||
2. Use that fork as a submodule.
|
||||
3. Commit all your changes to your fork.
|
||||
4. Pull new stuff from the main repository from time to time.
|
||||
@ -1308,14 +1411,14 @@ Remote debug Laravel web and phpunit tests.
|
||||
|
||||
<br>
|
||||
<a name="upgrading-laradock"></a>
|
||||
## Upgrading LaraDock
|
||||
## Upgrading Laradock
|
||||
|
||||
Moving from Docker Toolbox (VirtualBox) to Docker Native (for Mac/Windows). Requires upgrading LaraDock from v3.* to v4.*:
|
||||
Moving from Docker Toolbox (VirtualBox) to Docker Native (for Mac/Windows). Requires upgrading Laradock from v3.* to v4.*:
|
||||
|
||||
1. Stop the docker VM `docker-machine stop {default}`
|
||||
2. Install Docker for [Mac](https://docs.docker.com/docker-for-mac/) or [Windows](https://docs.docker.com/docker-for-windows/).
|
||||
3. Upgrade LaraDock to `v4.*.*` (`git pull origin master`)
|
||||
4. Use LaraDock as you used to do: `docker-compose up -d nginx mysql`.
|
||||
3. Upgrade Laradock to `v4.*.*` (`git pull origin master`)
|
||||
4. Use Laradock as you used to do: `docker-compose up -d nginx mysql`.
|
||||
|
||||
**Note:** If you face any problem with the last step above: rebuild all your containers
|
||||
`docker-compose build --no-cache`
|
||||
@ -1327,15 +1430,130 @@ Moving from Docker Toolbox (VirtualBox) to Docker Native (for Mac/Windows). Requ
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<br>
|
||||
<a name="Speed-MacOS"></a>
|
||||
## Improve speed on MacOS
|
||||
|
||||
Sharing code into Docker containers with osxfs have very poor performance compared to Linux. You can get around this issue by using NFS to share your files betwen your host and your container.
|
||||
Docker on the Mac [is slow](https://github.com/docker/for-mac/issues/77), at the time of writing. Especially for larger projects, this can be a problem. The problem is [older than March 2016](https://forums.docker.com/t/file-access-in-mounted-volumes-extremely-slow-cpu-bound/8076) - as it's a such a long-running issue, we're including it in the docs here.
|
||||
|
||||
> How to share files using NFS (d4m-nfs)
|
||||
So since sharing code into Docker containers with osxfs have very poor performance compared to Linux. Likely there are some workarounds:
|
||||
|
||||
[d4m-nfs](https://github.com/IFSight/d4m-nfs) automatically mount NFS volume instead of osxfs one.
|
||||
|
||||
|
||||
### Workaround A: using dinghy
|
||||
|
||||
[Dinghy](https://github.com/codekitchen/dinghy) creates its own VM using docker-machine, it will not modify your existing docker-machine VMs.
|
||||
|
||||
Quick Setup giude, (we recommend you check their docs)
|
||||
|
||||
1) `brew tap codekitchen/dinghy`
|
||||
|
||||
2) `brew install dinghy`
|
||||
|
||||
3) `dinghy create --provider virtualbox` (must have virtualbox installed, but they support other providers if you prefer)
|
||||
|
||||
4) after the above command is done it will display some env variables, copy them to the bash profile or zsh or.. (this will instruct docker to use the server running inside the VM)
|
||||
|
||||
5) `docker-compose up ...`
|
||||
|
||||
|
||||
|
||||
<br>
|
||||
<a name="Docker-Sync"></a>
|
||||
### Workaround B: using d4m-nfs
|
||||
|
||||
You can use the d4m-nfs solution in 2 ways, one is using the Laradock built it integration, and the other is using the tool separatly. Below is show case of both methods:
|
||||
|
||||
|
||||
#### B.1: using the built in d4m-nfs integration
|
||||
|
||||
In simple terms, docker-sync creates a docker container with a copy of all the application files that can be accessed very quickly from the other containers.
|
||||
On the other hand, docker-sync runs a process on the host machine that continuously tracks and updates files changes from the host to this intermediate container.
|
||||
|
||||
Out of the box, it comes pre-configured for OS X, but using it on Windows is very easy to set-up by modifying the `DOCKER_SYNC_STRATEGY` on the `.env`
|
||||
|
||||
##### Usage
|
||||
|
||||
Laradock comes with `sync.sh`, an optional bash script, that automates installing, running and stopping docker-sync. Note that to run the bash script you may need to change the permissions `chmod 755 sync.sh`
|
||||
|
||||
1) Configure your Laradock environment as you would normally do and test your application to make sure that your sites are running correctly.
|
||||
|
||||
2) Make sure to set `DOCKER_SYNC_STRATEGY` on the `.env`. Read the [syncing strategies](https://github.com/EugenMayer/docker-sync/wiki/8.-Strategies) for details.
|
||||
```
|
||||
# osx: 'native_osx' (default)
|
||||
# windows: 'unison'
|
||||
# linux: docker-sync not required
|
||||
|
||||
DOCKER_SYNC_STRATEGY=native_osx
|
||||
```
|
||||
|
||||
2) Install the docker-sync gem on the host-machine:
|
||||
```bash
|
||||
./sync.sh install
|
||||
```
|
||||
3) Start docker-sync and the Laradock environment.
|
||||
Specify the services you want to run, as you would normally do with `docker-compose up`
|
||||
```bash
|
||||
./sync.sh up nginx mysql
|
||||
```
|
||||
Please note that the first time docker-sync runs, it will copy all the files to the intermediate container and that may take a very long time (15min+).
|
||||
4) To stop the environment and docker-sync do:
|
||||
```bash
|
||||
./sync.sh down
|
||||
```
|
||||
|
||||
##### Setting up Aliases (optional)
|
||||
|
||||
You may create bash profile aliases to avoid having to remember and type these commands for everyday development.
|
||||
Add the following lines to your `~/.bash_profile`:
|
||||
|
||||
```bash
|
||||
alias devup="cd /PATH_TO_LARADOCK/laradock; ./sync.sh up nginx mysql" #add your services
|
||||
alias devbash="cd /PATH_TO_LARADOCK/laradock; ./sync.sh bash"
|
||||
alias devdown="cd /PATH_TO_LARADOCK/laradock; ./sync.sh down"
|
||||
```
|
||||
|
||||
Now from any location on your machine, you can simply run `devup`, `devbash` and `devdown`.
|
||||
|
||||
|
||||
##### Additional Commands
|
||||
|
||||
Opening bash on the workspace container (to run artisan for example):
|
||||
```bash
|
||||
./sync.sh bash
|
||||
```
|
||||
Manually triggering the synchronization of the files:
|
||||
```bash
|
||||
./sync.sh sync
|
||||
```
|
||||
Removing and cleaning up the files and the docker-sync container. Use only if you want to rebuild or remove docker-sync completely. The files on the host will be kept untouched.
|
||||
```bash
|
||||
./sync.sh clean
|
||||
```
|
||||
|
||||
|
||||
##### Additional Notes
|
||||
|
||||
- You may run laradock with or without docker-sync at any time using with the same `.env` and `docker-compose.yml`, because the configuration is overridden automatically when docker-sync is used.
|
||||
- You may inspect the `sync.sh` script to learn each of the commands and even add custom ones.
|
||||
- If a container cannot access the files on docker-sync, you may need to set a user on the Dockerfile of that container with an id of 1000 (this is the UID that nginx and php-fpm have configured on laradock). Alternatively, you may change the permissions to 777, but this is **not** recommended.
|
||||
|
||||
Visit the [docker-sync documentation](https://github.com/EugenMayer/docker-sync/wiki) for more details.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<br>
|
||||
|
||||
#### B.2: using the d4m-nfs tool
|
||||
|
||||
[D4m-nfs](https://github.com/IFSight/d4m-nfs) automatically mount NFS volume instead of osxfs one.
|
||||
|
||||
1) Update the Docker [File Sharing] preferences:
|
||||
|
||||
@ -1353,14 +1571,12 @@ git clone https://github.com/IFSight/d4m-nfs ~/d4m-nfs
|
||||
|
||||
```txt
|
||||
/Users:/Users
|
||||
/Volumes:/Volumes
|
||||
/private:/private
|
||||
```
|
||||
|
||||
5) Create (or edit) the file `/etc/exports`, make sure it exists and is empty. (There may be collisions if you come from Vagrant or if you already executed the `d4m-nfs.sh` script before).
|
||||
|
||||
|
||||
6) Run the `d4m-nfs.sh` script:
|
||||
6) Run the `d4m-nfs.sh` script (might need Sudo):
|
||||
|
||||
```bash
|
||||
~/d4m-nfs/d4m-nfs.sh
|
||||
@ -1369,10 +1585,19 @@ git clone https://github.com/IFSight/d4m-nfs ~/d4m-nfs
|
||||
That's it! Run your containers.. Example:
|
||||
|
||||
```bash
|
||||
docker-compose up -d nginx mysql
|
||||
docker-compose up ...
|
||||
```
|
||||
|
||||
**Note:** If you faced any errors, try restarting Docker, and make sure you have no spaces in the `d4m-nfs-mounts.txt` file, and your `/etc/exports` file is clear.
|
||||
*Note: If you faced any errors, try restarting Docker, and make sure you have no spaces in the `d4m-nfs-mounts.txt` file, and your `/etc/exports` file is clear.*
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -1454,4 +1679,8 @@ This error sometimes happens because your Laravel application isn't running on t
|
||||
1. Check your running Laravel application IP by dumping `Request::ip()` variable using `dd(Request::ip())` anywhere on your application. The result is the IP of your Laravel container.
|
||||
2. Change the `DB_HOST` variable on env with the IP that you received from previous step.
|
||||
* Option B
|
||||
1. Change the `DB_HOST` value to the same name as the MySQL docker container. The LaraDock docker-compose file currently has this as `mysql`
|
||||
1. Change the `DB_HOST` value to the same name as the MySQL docker container. The Laradock docker-compose file currently has this as `mysql`
|
||||
|
||||
## I get stuck when building nginx on `fetch http://mirrors.aliyun.com/alpine/v3.5/main/x86_64/APKINDEX.tar.gz`
|
||||
|
||||
As stated on [#749](https://github.com/laradock/laradock/issues/749#issuecomment-293296687), removing the line `RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/' /etc/apk/repositories` from `nginx/Dockerfile` solves the problem.
|
215
DOCUMENTATION/content/getting-started/index.md
Normal file
@ -0,0 +1,215 @@
|
||||
---
|
||||
title: Getting Started
|
||||
type: index
|
||||
weight: 2
|
||||
---
|
||||
|
||||
## Requirements
|
||||
|
||||
- [Git](https://git-scm.com/downloads)
|
||||
- [Docker](https://www.docker.com/products/docker/) `>= 1.12`
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## Installation
|
||||
|
||||
Choose the setup the best suits your needs.
|
||||
|
||||
- [A) Setup for Single Project](#A)
|
||||
- [A.1) Already have a PHP project](#A1)
|
||||
- [A.2) Don't have a PHP project yet](#A2)
|
||||
- [B) Setup for Multiple Projects](#B)
|
||||
|
||||
|
||||
<a name="A"></a>
|
||||
### A) Setup for Single Project
|
||||
> (Follow these steps if you want a separate Docker environment for each project)
|
||||
|
||||
|
||||
<a name="A1"></a>
|
||||
### A.1) Already have a PHP project:
|
||||
|
||||
1 - Clone laradock on your project root directory:
|
||||
|
||||
```bash
|
||||
git submodule add https://github.com/Laradock/laradock.git
|
||||
```
|
||||
|
||||
Note: If you are not using Git yet for your project, you can use `git clone` instead of `git submodule `.
|
||||
|
||||
*To keep track of your Laradock changes, between your projects and also keep Laradock updated [check these docs](/documentation/#keep-track-of-your-laradock-changes)*
|
||||
|
||||
|
||||
Your folder structure should look like this:
|
||||
|
||||
```
|
||||
+ project-a
|
||||
+ laradock-a
|
||||
+ project-b
|
||||
+ laradock-b
|
||||
```
|
||||
|
||||
*(It's important to rename the laradock folders to unique name in each project, if you want to run laradock per project).*
|
||||
|
||||
> **Now jump to the [Usage](#Usage) section.**
|
||||
|
||||
<a name="A2"></a>
|
||||
### A.2) Don't have a PHP project yet:
|
||||
|
||||
1 - Clone this repository anywhere on your machine:
|
||||
|
||||
```bash
|
||||
git clone https://github.com/laradock/laradock.git
|
||||
```
|
||||
|
||||
Your folder structure should look like this:
|
||||
|
||||
```
|
||||
+ laradock
|
||||
+ project-z
|
||||
```
|
||||
|
||||
2 - Edit your web server sites configuration.
|
||||
|
||||
We'll need to do step 1 of the [Usage](#Usage) section now to make this happen.
|
||||
|
||||
```
|
||||
cp env-example .env
|
||||
```
|
||||
|
||||
At the top, change the `APPLICATION` variable to your project path.
|
||||
|
||||
```
|
||||
APPLICATION=../project-z/
|
||||
```
|
||||
|
||||
Make sure to replace `project-z` with your project folder name.
|
||||
|
||||
> **Now jump to the [Usage](#Usage) section.**
|
||||
|
||||
|
||||
<a name="B"></a>
|
||||
### B) Setup for Multiple Projects:
|
||||
> (Follow these steps if you want a single Docker environment for all your project)
|
||||
|
||||
1 - Clone this repository anywhere on your machine (similar to [Steps A.2. from above](#A2)):
|
||||
|
||||
```bash
|
||||
git clone https://github.com/laradock/laradock.git
|
||||
```
|
||||
|
||||
Your folder structure should look like this:
|
||||
|
||||
```
|
||||
+ laradock
|
||||
+ project-1
|
||||
+ project-2
|
||||
```
|
||||
|
||||
2 - Go to `nginx/sites` and create config files to point to different project directory when visiting different domains.
|
||||
|
||||
Laradock by default includes `app.conf.example`, `laravel.conf.example` and `symfony.conf.example` as working samples.
|
||||
|
||||
3 - change the default names `*.conf`:
|
||||
|
||||
You can rename the config files, project folders and domains as you like, just make sure the `root` in the config files, is pointing to the correct project folder name.
|
||||
|
||||
4 - Add the domains to the **hosts** files.
|
||||
|
||||
```
|
||||
127.0.0.1 project-1.dev
|
||||
127.0.0.1 project-2.dev
|
||||
...
|
||||
```
|
||||
|
||||
> **Now jump to the [Usage](#Usage) section.**
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a name="Usage"></a>
|
||||
## Usage
|
||||
|
||||
**Read Before starting:**
|
||||
|
||||
If you are using **Docker Toolbox** (VM), do one of the following:
|
||||
|
||||
- Upgrade to Docker [Native](https://www.docker.com/products/docker) for Mac/Windows (Recommended). Check out [Upgrading Laradock](/documentation/#upgrading-laradock)
|
||||
- Use Laradock v3.\*. Visit the [Laradock-ToolBox](https://github.com/laradock/laradock/tree/Laradock-ToolBox) branch. *(outdated)*
|
||||
|
||||
<br>
|
||||
|
||||
We recommend using a Docker version which is newer than 1.13.
|
||||
|
||||
<br>
|
||||
|
||||
>**Warning:** If you used an older version of Laradock it's highly recommended to rebuild the containers you need to use [see how you rebuild a container](#Build-Re-build-Containers) in order to prevent as much errors as possible.
|
||||
|
||||
<br>
|
||||
|
||||
1 - Enter the laradock folder and copy `env-example` to `.env`
|
||||
|
||||
```shell
|
||||
cp env-example .env
|
||||
```
|
||||
|
||||
You can edit the `.env` file to chose which software's you want to be installed in your environment. You can always refer to the `docker-compose.yml` file to see how those variables are been used.
|
||||
|
||||
|
||||
2 - Build the enviroment and run it using `docker-compose`
|
||||
|
||||
In this example we'll see how to run NGINX (web server) and MySQL (database engine) to host a PHP Web Scripts:
|
||||
|
||||
```bash
|
||||
docker-compose up -d nginx mysql
|
||||
```
|
||||
|
||||
**Note**: The `workspace` and `php-fpm` will run automatically in most of the cases, so no need to specify them in the `up` command. If you couldn't find them running then you need specify them as follow: `docker-compose up -d nginx php-fpm mysql workspace`.
|
||||
|
||||
|
||||
You can select your own combination of containers form [this list](http://laradock.io/introduction/#supported-software-images).
|
||||
|
||||
*(Please note that sometimes we forget to update the docs, so check the `docker-compose.yml` file to see an updated list of all available containers).*
|
||||
|
||||
|
||||
<br>
|
||||
3 - Enter the Workspace container, to execute commands like (Artisan, Composer, PHPUnit, Gulp, ...)
|
||||
|
||||
```bash
|
||||
docker-compose exec workspace bash
|
||||
```
|
||||
|
||||
*Alternatively, for Windows PowerShell users: execute the following command to enter any running container:*
|
||||
|
||||
```bash
|
||||
docker exec -it {workspace-container-id} bash
|
||||
```
|
||||
|
||||
**Note:** You can add `--user=laradock` to have files created as your host's user. Example:
|
||||
|
||||
```shell
|
||||
docker-compose exec --user=laradock workspace bash
|
||||
```
|
||||
|
||||
*You can change the PUID (User id) and PGID (group id) variables from the `.env` file)*
|
||||
|
||||
<br>
|
||||
4 - Update your project configurations to use the database host
|
||||
|
||||
Open your PHP project's `.env` file or whichever configuration file you are reading from, and set the database host `DB_HOST` to `mysql`:
|
||||
|
||||
```env
|
||||
DB_HOST=mysql
|
||||
```
|
||||
|
||||
*If you want to install Laravel as PHP project, see [How to Install Laravel in a Docker Container](#Install-Laravel).*
|
||||
|
||||
<br>
|
||||
5 - Open your browser and visit your localhost address `http://localhost/`. If you followed the multiple projects setup, you can visit `http://project-1.dev/` and `http://project-2.dev/`.
|
885
DOCUMENTATION/content/guides/index.md
Normal file
@ -0,0 +1,885 @@
|
||||
---
|
||||
title: Guides
|
||||
type: index
|
||||
weight: 4
|
||||
---
|
||||
|
||||
|
||||
|
||||
* [Production Setup on Digital Ocean](#Digital-Ocean)
|
||||
* [PHPStorm XDebug Setup](#PHPStorm-Debugging)
|
||||
* [Running Laravel Dusk Test](#Laravel-Dusk)
|
||||
|
||||
|
||||
|
||||
<a name="Digital-Ocean"></a>
|
||||
# Production Setup on Digital Ocean
|
||||
|
||||
## Install Docker
|
||||
|
||||
- Visit [DigitalOcean](https://cloud.digitalocean.com/login) and login.
|
||||
- Click the `Create Droplet` button.
|
||||
- Open the `One-click apps` tab.
|
||||
- Select Docker with your preferred version.
|
||||
- Continue creating the droplet as you normally would.
|
||||
- If needed, check your e-mail for the droplet root password.
|
||||
|
||||
## SSH to your Server
|
||||
|
||||
Find the IP address of the droplet in the DigitalOcean interface. Use it to connect to the server.
|
||||
|
||||
```
|
||||
ssh root@ipaddress
|
||||
```
|
||||
|
||||
You may be prompted for a password. Type the one you found within your e-mailbox. It'll then ask you to change the password.
|
||||
|
||||
You can now check if Docker is available:
|
||||
|
||||
```
|
||||
$root@server:~# docker
|
||||
```
|
||||
|
||||
## Set Up Your Laravel Project
|
||||
|
||||
```
|
||||
$root@server:~# apt-get install git
|
||||
$root@server:~# git clone https://github.com/laravel/laravel
|
||||
$root@server:~# cd laravel
|
||||
$root@server:~/laravel/ git submodule add https://github.com/Laradock/laradock.git
|
||||
$root@server:~/laravel/ cd laradock
|
||||
```
|
||||
|
||||
## Install docker-compose command
|
||||
|
||||
```
|
||||
$root@server:~/laravel/laradock# curl -L https://github.com/docker/compose/releases/download/1.8.0/run.sh > /usr/local/bin/docker-compose
|
||||
$root@server:~/chmod +x /usr/local/bin/docker-compose
|
||||
```
|
||||
## Enter the laradock folder and rename env-example to .env.
|
||||
```
|
||||
$root@server:~/laravel/laradock# cp env-example .env
|
||||
```
|
||||
|
||||
## Create Your Laradock Containers
|
||||
|
||||
```
|
||||
$root@server:~/laravel/laradock# docker-compose up -d nginx mysql
|
||||
```
|
||||
|
||||
Note that more containers are available, find them in the [docs](http://laradock.io/introduction/#supported-software-containers) or the `docker-compose.yml` file.
|
||||
|
||||
## Go to Your Workspace
|
||||
|
||||
```
|
||||
docker-compose exec workspace bash
|
||||
```
|
||||
|
||||
## Install and configure Laravel
|
||||
|
||||
Let's install Laravel's dependencies, add the `.env` file, generate the key and give proper permissions to the cache folder.
|
||||
|
||||
```
|
||||
$ root@workspace:/var/www# composer install
|
||||
$ root@workspace:/var/www# cp .env.example .env
|
||||
$ root@workspace:/var/www# php artisan key:generate
|
||||
$ root@workspace:/var/www# exit
|
||||
$root@server:~/laravel/laradock# cd ..
|
||||
$root@server:~/laravel# sudo chmod -R 777 storage bootstrap/cache
|
||||
```
|
||||
|
||||
You can then view your Laravel site by visiting the IP address of your server in your browser. For example:
|
||||
|
||||
```
|
||||
http://192.168.1.1
|
||||
```
|
||||
|
||||
It should show you the Laravel default welcome page.
|
||||
|
||||
However, we want it to show up using your custom domain name, as well.
|
||||
|
||||
## Using Your Own Domain Name
|
||||
|
||||
Login to your DNS provider, such as Godaddy, Namecheap.
|
||||
|
||||
Point the Custom Domain Name Server to:
|
||||
|
||||
```
|
||||
ns1.digitalocean.com
|
||||
ns2.digitalocean.com
|
||||
ns3.digitalocean.com
|
||||
```
|
||||
|
||||
Within DigitalOcean, you'll need to change some settings, too.
|
||||
|
||||
Visit: https://cloud.digitalocean.com/networking/domains
|
||||
|
||||
Add your domain name and choose the server IP you'd provision earlier.
|
||||
|
||||
## Serving Site With NGINX (HTTP ONLY)
|
||||
|
||||
Go back to command line.
|
||||
|
||||
```
|
||||
$root@server:~/laravel/laradock# cd nginx
|
||||
$root@server:~/laravel/laradock/nginx# vim laravel.conf
|
||||
```
|
||||
|
||||
Remove `default_server`
|
||||
|
||||
```
|
||||
listen 80 default_server;
|
||||
listen [::]:80 default_server ipv6only=on;
|
||||
```
|
||||
|
||||
And add `server_name` (your custom domain)
|
||||
|
||||
```
|
||||
listen 80;
|
||||
listen [::]:80 ipv6only=on;
|
||||
server_name yourdomain.com;
|
||||
```
|
||||
|
||||
## Rebuild Your Nginx
|
||||
|
||||
```
|
||||
$root@server:~/laravel/laradock# docker-compose down
|
||||
$root@server:~/laravel/laradock# docker-compose build nginx
|
||||
```
|
||||
|
||||
## Re Run Your Containers MYSQL and NGINX
|
||||
|
||||
```
|
||||
$root@server:~/laravel/laradock/nginx# docker-compose up -d nginx mysql
|
||||
```
|
||||
|
||||
**View Your Site with HTTP ONLY (http://yourdomain.com)**
|
||||
|
||||
## Run Site on SSL with Let's Encrypt Certificate
|
||||
|
||||
**Note: You need to Use Caddy here Instead of Nginx**
|
||||
|
||||
To go Caddy Folders and Edit CaddyFile
|
||||
|
||||
```
|
||||
$root@server:~/laravel/laradock# cd caddy
|
||||
$root@server:~/laravel/laradock/caddy# vim Caddyfile
|
||||
```
|
||||
|
||||
Remove 0.0.0.0:80
|
||||
|
||||
```
|
||||
0.0.0.0:80
|
||||
root /var/www/public
|
||||
```
|
||||
|
||||
and replace with your https://yourdomain.com
|
||||
|
||||
```
|
||||
https://yourdomain.com
|
||||
root /var/www/public
|
||||
```
|
||||
|
||||
uncomment tls
|
||||
|
||||
```
|
||||
#tls self-signed
|
||||
```
|
||||
|
||||
and replace self-signed with your email address
|
||||
|
||||
```
|
||||
tls serverbreaker@gmai.com
|
||||
```
|
||||
|
||||
This is needed Prior to Creating Let's Encypt
|
||||
|
||||
## Run Your Caddy Container without the -d flag and Generate SSL with Let's Encrypt
|
||||
|
||||
```
|
||||
$root@server:~/laravel/laradock/caddy# docker-compose up caddy
|
||||
```
|
||||
|
||||
You'll be prompt here to enter your email... you may enter it or not
|
||||
|
||||
```
|
||||
Attaching to laradock_mysql_1, laradock_caddy_1
|
||||
caddy_1 | Activating privacy features...
|
||||
caddy_1 | Your sites will be served over HTTPS automatically using Let's Encrypt.
|
||||
caddy_1 | By continuing, you agree to the Let's Encrypt Subscriber Agreement at:
|
||||
caddy_1 | https://letsencrypt.org/documents/LE-SA-v1.0.1-July-27-2015.pdf
|
||||
caddy_1 | Activating privacy features... done.
|
||||
caddy_1 | https://yourdomain.com
|
||||
caddy_1 | http://yourdomain.com
|
||||
```
|
||||
|
||||
After it finishes, press `Ctrl` + `C` to exit.
|
||||
|
||||
## Stop All Containers and ReRun Caddy and Other Containers on Background
|
||||
|
||||
```
|
||||
$root@server:~/laravel/laradock/caddy# docker-compose down
|
||||
$root@server:~/laravel/laradock/caddy# docker-compose up -d mysql caddy
|
||||
```
|
||||
|
||||
View your Site in the Browser Securely Using HTTPS (https://yourdomain.com)
|
||||
|
||||
**Note that Certificate will be Automatically Renew By Caddy**
|
||||
|
||||
>References:
|
||||
>
|
||||
- [https://www.digitalocean.com/community/tutorials/how-to-install-and-use-docker-on-ubuntu-16-04](https://www.digitalocean.com/community/tutorials/how-to-install-and-use-docker-on-ubuntu-16-04)
|
||||
- [https://www.digitalocean.com/products/one-click-apps/docker/](https://www.digitalocean.com/products/one-click-apps/docker/)
|
||||
- [https://docs.docker.com/engine/installation/linux/ubuntulinux/](https://docs.docker.com/engine/installation/linux/ubuntulinux/)
|
||||
- [https://docs.docker.com/compose/install/](https://docs.docker.com/compose/install/)
|
||||
- [https://caddyserver.com/docs/automatic-https](https://caddyserver.com/docs/automatic-https)
|
||||
- [https://caddyserver.com/docs/tls](https://caddyserver.com/docs/tls)
|
||||
- [https://caddyserver.com/docs/caddyfile](https://caddyserver.com/docs/caddyfile)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<br>
|
||||
<br>
|
||||
<br>
|
||||
<br>
|
||||
<br>
|
||||
|
||||
<a name="PHPStorm-Debugging"></a>
|
||||
# PHPStorm XDebug Setup
|
||||
|
||||
- [Intro](#Intro)
|
||||
- [Installation](#Installation)
|
||||
- [Customize laradock/docker-compose.yml](#CustomizeDockerCompose)
|
||||
- [Clean House](#InstallCleanHouse)
|
||||
- [Laradock Dial Tone](#InstallLaradockDialTone)
|
||||
- [hosts](#AddToHosts)
|
||||
- [Firewall](#FireWall)
|
||||
- [Enable xDebug on php-fpm](#enablePhpXdebug)
|
||||
- [PHPStorm Settings](#InstallPHPStorm)
|
||||
- [Configs](#InstallPHPStormConfigs)
|
||||
- [Usage](#Usage)
|
||||
- [Laravel](#UsageLaravel)
|
||||
- [Run ExampleTest](#UsagePHPStormRunExampleTest)
|
||||
- [Debug ExampleTest](#UsagePHPStormDebugExampleTest)
|
||||
- [Debug Web Site](#UsagePHPStormDebugSite)
|
||||
- [SSH into workspace](#SSHintoWorkspace)
|
||||
- [KiTTY](#InstallKiTTY)
|
||||
|
||||
<a name="Intro"></a>
|
||||
## Intro
|
||||
|
||||
Wiring up [Laravel](https://laravel.com/), [Laradock](https://github.com/Laradock/laradock) [Laravel+Docker] and [PHPStorm](https://www.jetbrains.com/phpstorm/) to play nice together complete with remote xdebug'ing as icing on top! Although this guide is based on `PHPStorm Windows`,
|
||||
you should be able to adjust accordingly. This guide was written based on Docker for Windows Native.
|
||||
|
||||
<a name="Installation"></a>
|
||||
## Installation
|
||||
|
||||
- This guide assumes the following:
|
||||
- you have already installed and are familiar with Laravel, Laradock and PHPStorm.
|
||||
- you have installed Laravel as a parent of `laradock`. This guide assumes `/c/_dk/laravel`.
|
||||
|
||||
<a name="AddToHosts"></a>
|
||||
## hosts
|
||||
- Add `laravel` to your hosts file located on Windows 10 at `C:\Windows\System32\drivers\etc\hosts`. It should be set to the IP of your running container. Mine is: `10.0.75.2`
|
||||
On Windows you can find it by opening Windows `Hyper-V Manager`.
|
||||
- 
|
||||
|
||||
- [Hosts File Editor](https://github.com/scottlerch/HostsFileEditor) makes it easy to change your hosts file.
|
||||
- Set `laravel` to your docker host IP. See [Example](images/photos/SimpleHostsEditor/AddHost_laravel.png).
|
||||
|
||||
|
||||
<a name="FireWall"></a>
|
||||
## Firewall
|
||||
Your PHPStorm will need to be able to receive a connection from PHP xdebug either your running workspace or php-fpm containers on port 9000. This means that your Windows Firewall should either enable connections from the Application PHPStorm OR the port.
|
||||
|
||||
- It is important to note that if the Application PHPStorm is NOT enabled in the firewall, you will not be able to recreate a rule to override that.
|
||||
- Also be aware that if you are installing/upgrade different versions of PHPStorm, you MAY have orphaned references to PHPStorm in your Firewall! You may decide to remove orphaned references however in either case, make sure that they are set to receive public TCP traffic.
|
||||
|
||||
### Edit laradock/docker-compose.yml
|
||||
Set the following variables:
|
||||
```
|
||||
### Workspace Utilities Container ###############
|
||||
|
||||
workspace:
|
||||
build:
|
||||
context: ./workspace
|
||||
args:
|
||||
- INSTALL_XDEBUG=true
|
||||
- INSTALL_WORKSPACE_SSH=true
|
||||
...
|
||||
|
||||
|
||||
### PHP-FPM Container #####################
|
||||
|
||||
php-fpm:
|
||||
build:
|
||||
context: ./php-fpm
|
||||
args:
|
||||
- INSTALL_XDEBUG=true
|
||||
...
|
||||
|
||||
```
|
||||
|
||||
### Edit xdebug.ini files
|
||||
- `laradock/workspace/xdebug.ini`
|
||||
- `laradock/php-fpm/xdebug.ini`
|
||||
|
||||
Set the following variables:
|
||||
|
||||
```
|
||||
xdebug.remote_autostart=1
|
||||
xdebug.remote_enable=1
|
||||
xdebug.remote_connect_back=1
|
||||
xdebug.cli_color=1
|
||||
```
|
||||
|
||||
|
||||
<a name="InstallCleanHouse"></a>
|
||||
### Need to clean house first?
|
||||
|
||||
Make sure you are starting with a clean state. For example, do you have other Laradock containers and images?
|
||||
Here are a few things I use to clean things up.
|
||||
|
||||
- Delete all containers using `grep laradock_` on the names, see: [Remove all containers based on docker image name](https://linuxconfig.org/remove-all-containners-based-on-docker-image-name).
|
||||
|
||||
`docker ps -a | awk '{ print $1,$2 }' | grep laradock_ | awk '{print $1}' | xargs -I {} docker rm {}`
|
||||
|
||||
- Delete all images containing `laradock`.
|
||||
|
||||
`docker images | awk '{print $1,$2,$3}' | grep laradock_ | awk '{print $3}' | xargs -I {} docker rmi {}`
|
||||
**Note:** This will only delete images that were built with `Laradock`, **NOT** `laradock/*` which are pulled down by `Laradock` such as `laradock/workspace`, etc.
|
||||
**Note:** Some may fail with:
|
||||
`Error response from daemon: conflict: unable to delete 3f38eaed93df (cannot be forced) - image has dependent child images`
|
||||
|
||||
- I added this to my `.bashrc` to remove orphaned images.
|
||||
|
||||
```
|
||||
dclean() {
|
||||
processes=`docker ps -q -f status=exited`
|
||||
if [ -n "$processes" ]; thend
|
||||
docker rm $processes
|
||||
fi
|
||||
|
||||
images=`docker images -q -f dangling=true`
|
||||
if [ -n "$images" ]; then
|
||||
docker rmi $images
|
||||
fi
|
||||
}
|
||||
```
|
||||
|
||||
- If you frequently switch configurations for Laradock, you may find that adding the following and added to your `.bashrc` or equivalent useful:
|
||||
|
||||
```
|
||||
# remove laravel* containers
|
||||
# remove laravel_* images
|
||||
dcleanlaradockfunction()
|
||||
{
|
||||
echo 'Removing ALL containers associated with laradock'
|
||||
docker ps -a | awk '{ print $1,$2 }' | grep laradock | awk '{print $1}' | xargs -I {} docker rm {}
|
||||
|
||||
# remove ALL images associated with laradock_
|
||||
# does NOT delete laradock/* which are hub images
|
||||
echo 'Removing ALL images associated with laradock_'
|
||||
docker images | awk '{print $1,$2,$3}' | grep laradock_ | awk '{print $3}' | xargs -I {} docker rmi {}
|
||||
|
||||
echo 'Listing all laradock docker hub images...'
|
||||
docker images | grep laradock
|
||||
|
||||
echo 'dcleanlaradock completed'
|
||||
}
|
||||
# associate the above function with an alias
|
||||
# so can recall/lookup by typing 'alias'
|
||||
alias dcleanlaradock=dcleanlaradockfunction
|
||||
```
|
||||
|
||||
<a name="InstallLaradockDialTone"></a>
|
||||
## Let's get a dial-tone with Laravel
|
||||
|
||||
```
|
||||
# barebones at this point
|
||||
docker-compose up -d nginx mysql
|
||||
|
||||
# run
|
||||
docker-compose ps
|
||||
|
||||
# Should see:
|
||||
Name Command State Ports
|
||||
-----------------------------------------------------------------------------------------------------------
|
||||
laradock_mysql_1 docker-entrypoint.sh mysqld Up 0.0.0.0:3306->3306/tcp
|
||||
laradock_nginx_1 nginx Up 0.0.0.0:443->443/tcp, 0.0.0.0:80->80/tcp
|
||||
laradock_php-fpm_1 php-fpm Up 9000/tcp
|
||||
laradock_volumes_data_1 true Exit 0
|
||||
laradock_volumes_source_1 true Exit 0
|
||||
laradock_workspace_1 /sbin/my_init Up 0.0.0.0:2222->22/tcp
|
||||
```
|
||||
|
||||
<a name="enablePhpXdebug"></a>
|
||||
## Enable xDebug on php-fpm
|
||||
|
||||
In a host terminal sitting in the laradock folder, run: `.php-fpm/xdebug status`
|
||||
You should see something like the following:
|
||||
|
||||
```
|
||||
xDebug status
|
||||
laradock_php-fpm_1
|
||||
PHP 7.0.9 (cli) (built: Aug 10 2016 19:45:48) ( NTS )
|
||||
Copyright (c) 1997-2016 The PHP Group
|
||||
Zend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies
|
||||
with Xdebug v2.4.1, Copyright (c) 2002-2016, by Derick Rethans
|
||||
```
|
||||
|
||||
Other commands include `.php-fpm/xdebug start | stop`.
|
||||
|
||||
If you have enabled `xdebug=true` in `docker-compose.yml/php-fpm`, `xdebug` will already be running when
|
||||
`php-fpm` is started and listening for debug info on port 9000.
|
||||
|
||||
|
||||
<a name="InstallPHPStormConfigs"></a>
|
||||
## PHPStorm Settings
|
||||
|
||||
- Here are some settings that are known to work:
|
||||
- `Settings/BuildDeploymentConnection`
|
||||
- 
|
||||
|
||||
- `Settings/BuildDeploymentConnectionMappings`
|
||||
- 
|
||||
|
||||
- `Settings/BuildDeploymentDebugger`
|
||||
- 
|
||||
|
||||
- `Settings/EditRunConfigurationRemoteWebDebug`
|
||||
- 
|
||||
|
||||
- `Settings/EditRunConfigurationRemoteExampleTestDebug`
|
||||
- 
|
||||
|
||||
- `Settings/LangsPHPDebug`
|
||||
- 
|
||||
|
||||
- `Settings/LangsPHPInterpreters`
|
||||
- 
|
||||
|
||||
- `Settings/LangsPHPPHPUnit`
|
||||
- 
|
||||
|
||||
- `Settings/LangsPHPServers`
|
||||
- 
|
||||
|
||||
- `RemoteHost`
|
||||
To switch on this view, go to: `Menu/Tools/Deployment/Browse Remote Host`.
|
||||
- 
|
||||
|
||||
- `RemoteWebDebug`
|
||||
- 
|
||||
|
||||
- `EditRunConfigurationRemoteWebDebug`
|
||||
Go to: `Menu/Run/Edit Configurations`.
|
||||
- 
|
||||
|
||||
- `EditRunConfigurationRemoteExampleTestDebug`
|
||||
Go to: `Menu/Run/Edit Configurations`.
|
||||
- 
|
||||
|
||||
- `WindowsFirewallAllowedApps`
|
||||
Go to: `Control Panel\All Control Panel Items\Windows Firewall\Allowed apps`.
|
||||
- 
|
||||
|
||||
- `hosts`
|
||||
Edit: `C:\Windows\System32\drivers\etc\hosts`.
|
||||
- 
|
||||
|
||||
- [Enable xDebug on php-fpm](#enablePhpXdebug)
|
||||
|
||||
|
||||
|
||||
<a name="Usage"></a>
|
||||
## Usage
|
||||
|
||||
<a name="UsagePHPStormRunExampleTest"></a>
|
||||
### Run ExampleTest
|
||||
- right-click on `tests/ExampleTest.php`
|
||||
- Select: `Run 'ExampleTest.php'` or `Ctrl+Shift+F10`.
|
||||
- Should pass!! You just ran a remote test via SSH!
|
||||
|
||||
<a name="UsagePHPStormDebugExampleTest"></a>
|
||||
### Debug ExampleTest
|
||||
- Open to edit: `tests/ExampleTest.php`
|
||||
- Add a BreakPoint on line 16: `$this->visit('/')`
|
||||
- right-click on `tests/ExampleTest.php`
|
||||
- Select: `Debug 'ExampleTest.php'`.
|
||||
- Should have stopped at the BreakPoint!! You are now debugging locally against a remote Laravel project via SSH!
|
||||
- 
|
||||
|
||||
|
||||
<a name="UsagePHPStormDebugSite"></a>
|
||||
### Debug WebSite
|
||||
- In case xDebug is disabled, from the `laradock` folder run:
|
||||
`.php-fpm/xdebug start`.
|
||||
- To switch xdebug off, run:
|
||||
`.php-fpm/xdebug stop`
|
||||
|
||||
- Start Remote Debugging
|
||||
- 
|
||||
|
||||
- Open to edit: `bootstrap/app.php`
|
||||
- Add a BreakPoint on line 14: `$app = new Illuminate\Foundation\Application(`
|
||||
- Reload [Laravel Site](http://laravel/)
|
||||
- Should have stopped at the BreakPoint!! You are now debugging locally against a remote Laravel project via SSH!
|
||||
- 
|
||||
|
||||
|
||||
<a name="SSHintoWorkspace"></a>
|
||||
## Let's shell into workspace
|
||||
Assuming that you are in laradock folder, type:
|
||||
`ssh -i workspace/insecure_id_rsa -p2222 root@laravel`
|
||||
**Cha Ching!!!!**
|
||||
- `workspace/insecure_id_rsa.ppk` may become corrupted. In which case:
|
||||
- fire up `puttygen`
|
||||
- import `workspace/insecure_id_rsa`
|
||||
- save private key to `workspace/insecure_id_rsa.ppk`
|
||||
|
||||
<a name="InstallKiTTY"></a>
|
||||
|
||||
### KiTTY
|
||||
[Kitty](http://www.9bis.net/kitty/) KiTTY is a fork from version 0.67 of PuTTY.
|
||||
|
||||
- Here are some settings that are working for me:
|
||||
- 
|
||||
- 
|
||||
- 
|
||||
- 
|
||||
- 
|
||||
- 
|
||||
- 
|
||||
- 
|
||||
- 
|
||||
|
||||
<br>
|
||||
<br>
|
||||
<br>
|
||||
<br>
|
||||
<br>
|
||||
|
||||
<a name="Laravel-Dusk"></a>
|
||||
# Running Laravel Dusk Tests
|
||||
|
||||
- [Option 1: Without Selenium](#option1-dusk)
|
||||
- [Option 2: With Selenium](#option2-dusk)
|
||||
|
||||
<a name="option1-dusk"></a>
|
||||
## Option 1: Without Selenium
|
||||
|
||||
- [Intro](#option1-dusk-intro)
|
||||
- [Workspace Setup](#option1-workspace-setup)
|
||||
- [Application Setup](#option1-application-setup)
|
||||
- [Choose Chrome Driver Version (Optional)](#option1-choose-chrome-driver-version)
|
||||
- [Run Dusk Tests](#option1-run-dusk-tests)
|
||||
|
||||
<a name="option1-dusk-intro"></a>
|
||||
### Intro
|
||||
|
||||
This is a guide to run Dusk tests in your `workspace` container with headless
|
||||
google-chrome and chromedriver. It has been tested with Laravel 5.4 and 5.5.
|
||||
|
||||
<a name="option1-workspace-setup"></a>
|
||||
### Workspace Setup
|
||||
|
||||
Update your .env with following entries:
|
||||
|
||||
```
|
||||
...
|
||||
# Install Laravel installer bin to setup demo app
|
||||
WORKSPACE_INSTALL_LARAVEL_INSTALLER=true
|
||||
...
|
||||
# Install all the necessary dependencies for running Dusk tests
|
||||
WORKSPACE_INSTALL_DUSK_DEPS=true
|
||||
...
|
||||
```
|
||||
|
||||
Then run below to build your workspace.
|
||||
|
||||
```
|
||||
docker-compose build workspace
|
||||
```
|
||||
|
||||
<a name="option1-application-setup"></a>
|
||||
### Application Setup
|
||||
|
||||
Run a `workspace` container and you will be inside the container at `/var/www` directory.
|
||||
|
||||
```
|
||||
docker-compose run workspace bash
|
||||
|
||||
/var/www#> _
|
||||
```
|
||||
|
||||
Create new Laravel application named `dusk-test` and install Laravel Dusk package.
|
||||
|
||||
```
|
||||
/var/www> laravel new dusk-test
|
||||
/var/www> cd dusk-test
|
||||
/var/www/dusk-test> composer require --dev laravel/dusk
|
||||
/var/www/dusk-test> php artisan dusk:install
|
||||
```
|
||||
|
||||
Create `.env.dusk.local` by copying from `.env` file.
|
||||
|
||||
```
|
||||
/var/www/dusk-test> cp .env .env.dusk.local
|
||||
```
|
||||
|
||||
Update the `APP_URL` entry in `.env.dusk.local` to local Laravel server.
|
||||
|
||||
```
|
||||
APP_URL=http://localhost:8000
|
||||
```
|
||||
|
||||
You will need to run chromedriver with `headless` and `no-sandbox` flag. In Laravel Dusk 2.x it is
|
||||
already set `headless` so you just need to add `no-sandbox` flag. If you on previous version 1.x,
|
||||
you will need to update your `DustTestCase#driver` as shown below.
|
||||
|
||||
|
||||
```
|
||||
<?php
|
||||
|
||||
...
|
||||
|
||||
abstract class DuskTestCase extends BaseTestCase
|
||||
{
|
||||
...
|
||||
|
||||
/**
|
||||
* Update chrome driver with below flags
|
||||
*/
|
||||
protected function driver()
|
||||
{
|
||||
$options = (new ChromeOptions)->addArguments([
|
||||
'--disable-gpu',
|
||||
'--headless',
|
||||
'--no-sandbox'
|
||||
]);
|
||||
|
||||
return RemoteWebDriver::create(
|
||||
'http://localhost:9515', DesiredCapabilities::chrome()->setCapability(
|
||||
ChromeOptions::CAPABILITY, $options
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
<a name="option1-choose-chrome-driver-version"></a>
|
||||
### Choose Chrome Driver Version (Optional)
|
||||
|
||||
You could choose to use either:
|
||||
|
||||
1. Chrome Driver shipped with Laravel Dusk. (Default)
|
||||
2. Chrome Driver installed in `workspace` container. (Required tweak on DuskTestCase class)
|
||||
|
||||
For Laravel 2.x, you need to update `DuskTestCase#prepare` method if you wish to go with option #2.
|
||||
|
||||
```
|
||||
|
||||
<?php
|
||||
|
||||
...
|
||||
abstract class DuskTestCase extends BaseTestCase
|
||||
{
|
||||
...
|
||||
public static function prepare()
|
||||
{
|
||||
// Only add this line if you wish to use chrome driver installed in workspace container.
|
||||
// You might want to read the file path from env file.
|
||||
static::useChromedriver('/usr/local/bin/chromedriver');
|
||||
|
||||
static::startChromeDriver();
|
||||
}
|
||||
```
|
||||
|
||||
For Laravel 1.x, you need to add `DuskTestCase#buildChromeProcess` method if you wish to go with option #2.
|
||||
|
||||
```
|
||||
<?php
|
||||
|
||||
...
|
||||
use Symfony\Component\Process\ProcessBuilder;
|
||||
|
||||
abstract class DuskTestCase extends BaseTestCase
|
||||
{
|
||||
...
|
||||
|
||||
/**
|
||||
* Only add this method if you wish to use chrome driver installed in workspace container
|
||||
*/
|
||||
protected static function buildChromeProcess()
|
||||
{
|
||||
return (new ProcessBuilder())
|
||||
->setPrefix('chromedriver')
|
||||
->getProcess()
|
||||
->setEnv(static::chromeEnvironment());
|
||||
}
|
||||
|
||||
...
|
||||
}
|
||||
```
|
||||
|
||||
<a name="option1-run-dusk-tests"></a>
|
||||
### Run Dusk Tests
|
||||
|
||||
Run local server in `workspace` container and run Dusk tests.
|
||||
|
||||
```
|
||||
# alias to run Laravel server in the background (php artisan serve --quiet &)
|
||||
/var/www/dusk-test> serve
|
||||
# alias to run Dusk tests (php artisan dusk)
|
||||
/var/www/dusk-test> dusk
|
||||
|
||||
PHPUnit 6.4.0 by Sebastian Bergmann and contributors.
|
||||
|
||||
. 1 / 1 (100%)
|
||||
|
||||
Time: 837 ms, Memory: 6.00MB
|
||||
```
|
||||
|
||||
<a name="option2-dusk"></a>
|
||||
## Option 2: With Selenium
|
||||
|
||||
- [Intro](#dusk-intro)
|
||||
- [DNS Setup](#dns-setup)
|
||||
- [Docker Compose Setup](#docker-compose)
|
||||
- [Laravel Dusk Setup](#laravel-dusk-setup)
|
||||
- [Running Laravel Dusk Tests](#running-tests)
|
||||
|
||||
<a name="dusk-intro"></a>
|
||||
### Intro
|
||||
Setting up Laravel Dusk tests to run with Laradock appears be something that
|
||||
eludes most Laradock users. This guide is designed to show you how to wire them
|
||||
up to work together. This guide is written with macOS and Linux in mind. As such,
|
||||
it's only been tested on macOS. Feel free to create pull requests to update the guide
|
||||
for Windows-specific instructions.
|
||||
|
||||
This guide assumes you know how to use a DNS forwarder such as `dnsmasq` or are comfortable
|
||||
with editing the `/etc/hosts` file for one-off DNS changes.
|
||||
|
||||
<a name="dns-setup"></a>
|
||||
### DNS Setup
|
||||
According to RFC-2606, only four TLDs are reserved for local testing[^1]:
|
||||
|
||||
- `.test`
|
||||
- `.example`
|
||||
- `.invalid`
|
||||
- `.localhost`
|
||||
|
||||
A common TLD used for local development is `.dev`, but newer versions of Google
|
||||
Chrome (such as the one bundled with the Selenium Docker image), will fail to
|
||||
resolve that DNS as there will appear to be a name collision.
|
||||
|
||||
The recommended extension is `.test` for your Laravel web apps because you're
|
||||
running tests. Using a DNS forwarder such as `dnsmasq` or by editing the `/etc/hosts`
|
||||
file, configure the host to point to `localhost`.
|
||||
|
||||
For example, in your `/etc/hosts` file:
|
||||
```
|
||||
##
|
||||
# Host Database
|
||||
#
|
||||
# localhost is used to configure the loopback interface
|
||||
# when the system is booting. Do not change this entry.
|
||||
##
|
||||
127.0.0.1 localhost
|
||||
255.255.255.255 broadcasthost
|
||||
::1 localhost
|
||||
127.0.0.1 myapp.test
|
||||
```
|
||||
|
||||
This will ensure that when navigating to `myapp.test`, it will route the
|
||||
request to `127.0.0.1` which will be handled by Nginx in Laradock.
|
||||
|
||||
<a name="docker-compose"></a>
|
||||
### Docker Compose setup
|
||||
In order to make the Selenium container talk to the Nginx container appropriately,
|
||||
the `docker-compose.yml` needs to be edited to accommodate this. Make the following
|
||||
changes:
|
||||
|
||||
```yaml
|
||||
...
|
||||
selenium:
|
||||
...
|
||||
depends_on:
|
||||
- nginx
|
||||
links:
|
||||
- nginx:<your_domain>
|
||||
```
|
||||
|
||||
This allows network communication between the Nginx and Selenium containers
|
||||
and it also ensures that when starting the Selenium container, the Nginx
|
||||
container starts up first unless it's already running. This allows
|
||||
the Selenium container to make requests to the Nginx container, which is
|
||||
necessary for running Dusk tests. These changes also link the `nginx` environment
|
||||
variable to the domain you wired up in your hosts file.
|
||||
|
||||
<a name="laravel-dusk-setup"></a>
|
||||
### Laravel Dusk Setup
|
||||
|
||||
In order to make Laravel Dusk make the proper request to the Selenium container,
|
||||
you have to edit the `DuskTestCase.php` file that's provided on the initial
|
||||
installation of Laravel Dusk. The change you have to make deals with the URL the
|
||||
Remote Web Driver attempts to use to set up the Selenium session.
|
||||
|
||||
One recommendation for this is to add a separate config option in your `.env.dusk.local`
|
||||
so it's still possible to run your Dusk tests locally should you want to.
|
||||
|
||||
#### .env.dusk.local
|
||||
```
|
||||
...
|
||||
USE_SELENIUM=true
|
||||
```
|
||||
|
||||
#### DuskTestCase.php
|
||||
```php
|
||||
abstract class DuskTestCase extends BaseTestCase
|
||||
{
|
||||
...
|
||||
protected function driver()
|
||||
{
|
||||
if (env('USE_SELENIUM', 'false') == 'true') {
|
||||
return RemoteWebDriver::create(
|
||||
'http://selenium:4444/wd/hub', DesiredCapabilities::chrome()
|
||||
);
|
||||
} else {
|
||||
return RemoteWebDriver::create(
|
||||
'http://localhost:9515', DesiredCapabilities::chrome()
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
<a name="running-tests"></a>
|
||||
### Running Laravel Dusk Tests
|
||||
|
||||
Now that you have everything set up, to run your Dusk tests, you have to SSH
|
||||
into the workspace container as you normally would:
|
||||
```docker-compose exec --user=laradock workspace bash```
|
||||
|
||||
Once inside, you can change directory to your application and run:
|
||||
|
||||
```php artisan dusk```
|
||||
|
||||
One way to make this easier from your project is to create a helper script. Here's one such example:
|
||||
```bash
|
||||
#!/usr/bin/env sh
|
||||
|
||||
LARADOCK_HOME="path/to/laradock"
|
||||
|
||||
pushd ${LARADOCK_HOME}
|
||||
|
||||
docker-compose exec --user=laradock workspace bash -c "cd my-project && php artisan dusk && exit"
|
||||
```
|
||||
|
||||
This invokes the Dusk command from inside the workspace container but when the script completes
|
||||
execution, it returns your session to your project directory.
|
||||
|
||||
[^1]: [Don't Use .dev for Development](https://iyware.com/dont-use-dev-for-development/)
|
@ -4,6 +4,6 @@ type: index
|
||||
weight: 5
|
||||
---
|
||||
|
||||
Join the chat room on [Gitter](https://gitter.im/LaraDock/laradock) and get help and support from the community.
|
||||
Join the chat room on [Gitter](https://gitter.im/Laradock/laradock) and get help and support from the community.
|
||||
|
||||
You can as well can open an [issue](https://github.com/laradock/laradock/issues) on Github (will be labeled as Question) and discuss it with people on [Gitter](https://gitter.im/LaraDock/laradock).
|
||||
You can as well can open an [issue](https://github.com/laradock/laradock/issues) on Github (will be labeled as Question) and discuss it with people on [Gitter](https://gitter.im/Laradock/laradock).
|
172
DOCUMENTATION/content/introduction/index.md
Normal file
@ -0,0 +1,172 @@
|
||||
---
|
||||
title: Introduction
|
||||
type: index
|
||||
weight: 1
|
||||
---
|
||||
|
||||
|
||||
|
||||
|
||||
A full PHP development environment for Docker.
|
||||
|
||||
Includes pre-packaged Docker Images, all pre-configured to provide a wonderful PHP development environment.
|
||||
|
||||
Laradock is well known in the Laravel community, as the project started with single focus on running Laravel projects on Docker. Later and due to the large adoption from the PHP community, it started supporting other PHP projects like Symfony, CodeIgniter, WordPress, Drupal...
|
||||
|
||||
|
||||

|
||||
|
||||
## Quick Overview
|
||||
|
||||
Let's see how easy it is to install `NGINX`, `PHP`, `Composer`, `MySQL`, `Redis` and `Beanstalkd`:
|
||||
|
||||
1 - Clone Laradock inside your PHP project:
|
||||
|
||||
```shell
|
||||
git clone https://github.com/Laradock/laradock.git
|
||||
```
|
||||
|
||||
2 - Enter the laradock folder and rename `env-example` to `.env`.
|
||||
|
||||
```shell
|
||||
cp env-example .env
|
||||
```
|
||||
|
||||
3 - Run your containers:
|
||||
|
||||
```shell
|
||||
docker-compose up -d nginx mysql redis beanstalkd
|
||||
```
|
||||
|
||||
4 - Open your project's `.env` file and set the following:
|
||||
|
||||
```shell
|
||||
DB_HOST=mysql
|
||||
REDIS_HOST=redis
|
||||
QUEUE_HOST=beanstalkd
|
||||
```
|
||||
|
||||
5 - Open your browser and visit localhost: `http://localhost`.
|
||||
|
||||
```shell
|
||||
That's it! enjoy :)
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
<a name="features"></a>
|
||||
## Features
|
||||
|
||||
- Easy switch between PHP versions: 7.1, 7.0, 5.6...
|
||||
- Choose your favorite database engine: MySQL, Postgres, MariaDB...
|
||||
- Run your own combination of software: Memcached, HHVM, Beanstalkd...
|
||||
- Every software runs on a separate container: PHP-FPM, NGINX, PHP-CLI...
|
||||
- Easy to customize any container, with simple edit to the `Dockerfile`.
|
||||
- All Images extends from an official base Image. (Trusted base Images).
|
||||
- Pre-configured NGINX to host any code at your root directory.
|
||||
- Can use Laradock per project, or single Laradock for all projects.
|
||||
- Easy to install/remove software's in Containers using environment variables.
|
||||
- Clean and well structured Dockerfiles (`Dockerfile`).
|
||||
- Latest version of the Docker Compose file (`docker-compose`).
|
||||
- Everything is visible and editable.
|
||||
- Fast Images Builds.
|
||||
- More to come every week..
|
||||
|
||||
|
||||
|
||||
|
||||
<a name="Supported-Containers"></a>
|
||||
## Supported Software (Images)
|
||||
|
||||
In adhering to the separation of concerns principle as promoted by Docker, Laradock runs each software on its own Container.
|
||||
You can turn On/Off as many instances of as any container without worrying about the configurations, everything works like a charm.
|
||||
|
||||
- **Database Engines:**
|
||||
MySQL - MariaDB - Percona - MongoDB - Neo4j - RethinkDB - MSSQL - PostgreSQL - Postgres-PostGIS.
|
||||
- **Database Management:**
|
||||
PhpMyAdmin - Adminer - PgAdmin
|
||||
- **Cache Engines:**
|
||||
Redis - Memcached - Aerospike
|
||||
- **PHP Servers:**
|
||||
NGINX - Apache2 - Caddy
|
||||
- **PHP Compilers:**
|
||||
PHP FPM - HHVM
|
||||
- **Message Queueing:**
|
||||
Beanstalkd - RabbitMQ - PHP Worker
|
||||
- **Queueing Management:**
|
||||
Beanstalkd Console - RabbitMQ Console
|
||||
- **Random Tools:**
|
||||
HAProxy - Certbot - Blackfire - Selenium - Jenkins - ElasticSearch - Kibana - Mailhog - Minio - Varnish - Swoole - Laravel Echo...
|
||||
|
||||
Laradock introduces the **Workspace** Image, as a development environment.
|
||||
It contains a rich set of helpful tools, all pre-configured to work and integrate with almost any combination of Containers and tools you may choose.
|
||||
|
||||
**Workspace Image Tools**
|
||||
PHP CLI - Composer - Git - Linuxbrew - Node - V8JS - Gulp - SQLite - xDebug - Envoy - Deployer - Vim - Yarn - SOAP - Drush...
|
||||
|
||||
You can choose, which tools to install in your workspace container and other containers, from the `.env` file.
|
||||
|
||||
|
||||
> If you modify `docker-compose.yml`, `.env` or any `dockerfile` file, you must re-build your containers, to see those effects in the running instance.
|
||||
|
||||
|
||||
|
||||
If you can't find your Software in the list, build it yourself and submit it. Contributions are welcomed :)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a name="what-is-docker"></a>
|
||||
## What is Docker?
|
||||
|
||||
[Docker](https://www.docker.com) is an open platform for developing, shipping, and running applications.
|
||||
Docker enables you to separate your applications from your infrastructure so you can deliver software quickly.
|
||||
With Docker, you can manage your infrastructure in the same ways you manage your applications.
|
||||
By taking advantage of Docker’s methodologies for shipping, testing, and deploying code quickly, you can significantly reduce the delay between writing code and running it in production.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a name="why-docker-not-vagrant"></a>
|
||||
## Why Docker not Vagrant!?
|
||||
|
||||
[Vagrant](https://www.vagrantup.com) creates Virtual Machines in minutes while Docker creates Virtual Containers in seconds.
|
||||
|
||||
Instead of providing a full Virtual Machines, like you get with Vagrant, Docker provides you **lightweight** Virtual Containers, that share the same kernel and allow to safely execute independent processes.
|
||||
|
||||
In addition to the speed, Docker gives tons of features that cannot be achieved with Vagrant.
|
||||
|
||||
Most importantly Docker can run on Development and on Production (same environment everywhere). While Vagrant is designed for Development only, (so you have to re-provision your server on Production every time).
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a name="Demo"></a>
|
||||
## Demo Video
|
||||
|
||||
What's better than a **Demo Video**:
|
||||
|
||||
- Laradock v5.* (should be next!)
|
||||
- Laradock [v4.*](https://www.youtube.com/watch?v=TQii1jDa96Y)
|
||||
- Laradock [v2.*](https://www.youtube.com/watch?v=-DamFMczwDA)
|
||||
- Laradock [v0.3](https://www.youtube.com/watch?v=jGkyO6Is_aI)
|
||||
- Laradock [v0.1](https://www.youtube.com/watch?v=3YQsHe6oF80)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a name="Chat"></a>
|
||||
## Chat with us
|
||||
|
||||
You are welcome to join our chat room on Gitter.
|
||||
|
||||
[](https://gitter.im/Laradock/laradock?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
|
@ -1,7 +1,7 @@
|
||||
---
|
||||
title: License
|
||||
type: index
|
||||
weight: 7
|
||||
weight: 8
|
||||
---
|
||||
|
||||
[MIT License](https://github.com/laradock/laradock/blob/master/LICENSE) (MIT)
|
@ -1,13 +1,13 @@
|
||||
---
|
||||
title: Related Projects
|
||||
type: index
|
||||
weight: 4
|
||||
weight: 6
|
||||
---
|
||||
|
||||
LaraDock related projects:
|
||||
Laradock related projects:
|
||||
|
||||
* [LaraDock CLI](https://github.com/lorinlee/laradock-cli) by [LorinLee](https://github.com/lorinlee)
|
||||
* [LaraDock Env](https://github.com/bagart/laradock_env) by [BAGArt](https://github.com/bagart)
|
||||
* [Laradock CLI](https://github.com/lorinlee/laradock-cli) by [LorinLee](https://github.com/lorinlee)
|
||||
* [Laradock Env](https://github.com/bagart/laradock_env) by [BAGArt](https://github.com/bagart)
|
||||
* [Klaradock](https://github.com/poyhsiao/Klaradock) by [Kim Hsiao](https://github.com/poyhsiao)
|
||||
* [Ansible Laradock Kubernetes](https://github.com/sifat-rahim/ansible-laradock-kubernetes) by [Sifat Rahim](https://github.com/sifat-rahim)
|
||||
These Docker Compose projects have piqued our interest:
|
@ -37,7 +37,9 @@
|
||||
Documentation built with
|
||||
<a href="https://www.gohugo.io" target="_blank">Hugo</a>
|
||||
using the
|
||||
<a href="http://github.com/digitalcraftsman/hugo-material-docs" target="_blank">Material</a> theme.
|
||||
<a href="http://github.com/digitalcraftsman/hugo-material-docs" target="_blank">Material</a> theme,
|
||||
by
|
||||
<a href="https://zalt.me">Mahmoud Zalt</a>.
|
||||
</aside>
|
||||
|
||||
<footer class="footer">
|
@ -6,13 +6,13 @@
|
||||
<img src="{{ $.Site.BaseURL }}{{ . }}">
|
||||
</div>
|
||||
{{ end }}
|
||||
<div class="name">
|
||||
<strong>{{ .Site.Title }} {{ with .Site.Params.version }}<span class="version">{{ . }}</span>{{ end }}</strong>
|
||||
{{ with .Scratch.Get "repo_id" }}
|
||||
<br>
|
||||
{{ . }}
|
||||
{{ end }}
|
||||
</div>
|
||||
<!--<div class="name">-->
|
||||
<!--<strong>{{ .Site.Title }} {{ with .Site.Params.version }}<span class="version">{{ . }}</span>{{ end }}</strong>-->
|
||||
<!--{{ with .Scratch.Get "repo_id" }}-->
|
||||
<!--<br>-->
|
||||
<!--{{ . }}-->
|
||||
<!--{{ end }}-->
|
||||
<!--</div>-->
|
||||
</div>
|
||||
</a>
|
||||
|
||||
@ -43,8 +43,8 @@
|
||||
{{ end }}
|
||||
|
||||
{{ if isset .Site.Params "author" }}
|
||||
<hr>
|
||||
<span class="section">The author</span>
|
||||
<!--<hr>-->
|
||||
<!--<span class="section">The author</span>-->
|
||||
|
||||
<ul>
|
||||
{{ with .Site.Social.twitter }}
|
||||
@ -55,13 +55,13 @@
|
||||
</li>
|
||||
{{ end }}
|
||||
|
||||
{{ with .Site.Social.github }}
|
||||
<li>
|
||||
<a href="https://github.com/{{ . }}" target="_blank" title="@{{ . }} on GitHub">
|
||||
@{{ . }} on GitHub
|
||||
</a>
|
||||
</li>
|
||||
{{ end }}
|
||||
<!--{{ with .Site.Social.github }}-->
|
||||
<!--<li>-->
|
||||
<!--<a href="https://github.com/{{ . }}" target="_blank" title="@{{ . }} on GitHub">-->
|
||||
<!--@{{ . }} on GitHub-->
|
||||
<!--</a>-->
|
||||
<!--</li>-->
|
||||
<!--{{ end }}-->
|
||||
|
||||
{{ with .Site.Social.email }}
|
||||
<li>
|
@ -7,7 +7,7 @@
|
||||
</div>
|
||||
<div class="stretch">
|
||||
<div class="title">
|
||||
{{ .Title }}
|
||||
<b>{{ .Site.Title }}</b> <span style="color: rgba(249, 245, 255, 0.63);"> / {{ .Title }}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -19,8 +19,9 @@
|
||||
|
||||
{{ with .Site.Social.github }}
|
||||
<div class="button button-github" role="button" aria-label="GitHub">
|
||||
<a href="https://github.com/{{ . }}" title="@{{ . }} on GitHub" target="_blank" class="toggle-button icon icon-github"></a>
|
||||
<a style="padding: 0px; font-size:40px" href="https://github.com/{{ . }}" title="@{{ . }} on GitHub" target="_blank" class="toggle-button icon icon-github"></a>
|
||||
</div>
|
||||
<p style="font-size: 18px; padding: 8px">Github</p>
|
||||
{{ end }}
|
||||
|
||||
<!-- TODO: disabled until Hugo supports the generation of a content index natively
|
||||
@ -42,4 +43,4 @@
|
||||
<button class="toggle-button icon icon-close" id="reset-search"></button>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
</nav>
|
Before Width: | Height: | Size: 4.3 KiB After Width: | Height: | Size: 4.3 KiB |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
BIN
DOCUMENTATION/themes/hugo-material-docs/static/images/logo.png
Normal file
After Width: | Height: | Size: 142 KiB |
Before Width: | Height: | Size: 22 KiB After Width: | Height: | Size: 22 KiB |
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 16 KiB |
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 15 KiB |
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 16 KiB |
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 16 KiB |
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 18 KiB |
Before Width: | Height: | Size: 3.3 KiB After Width: | Height: | Size: 3.3 KiB |
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 15 KiB |
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 20 KiB |
Before Width: | Height: | Size: 3.8 KiB After Width: | Height: | Size: 3.8 KiB |
Before Width: | Height: | Size: 74 KiB After Width: | Height: | Size: 74 KiB |
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 17 KiB |
Before Width: | Height: | Size: 80 KiB After Width: | Height: | Size: 80 KiB |
Before Width: | Height: | Size: 68 KiB After Width: | Height: | Size: 68 KiB |
Before Width: | Height: | Size: 30 KiB After Width: | Height: | Size: 30 KiB |
Before Width: | Height: | Size: 23 KiB After Width: | Height: | Size: 23 KiB |
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 15 KiB |
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 19 KiB |
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 43 KiB After Width: | Height: | Size: 43 KiB |
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 20 KiB |
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 21 KiB |
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 18 KiB |
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 70 KiB After Width: | Height: | Size: 70 KiB |
Before Width: | Height: | Size: 9.5 KiB After Width: | Height: | Size: 9.5 KiB |
After Width: | Height: | Size: 85 KiB |
After Width: | Height: | Size: 64 KiB |
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 18 KiB |
@ -3,7 +3,7 @@
|
||||
* theme that is used as fallback in codeblocks
|
||||
*/
|
||||
.article pre code {
|
||||
color: rgba(0, 0, 0, 0.8) !important;
|
||||
color: rgba(0, 0, 0, 0.78) !important;
|
||||
}
|
||||
|
||||
|
||||
@ -103,3 +103,14 @@ font-style:italic;
|
||||
.hljs-strong {
|
||||
font-weight:700;
|
||||
}
|
||||
|
||||
/*
|
||||
OVERRIDING THE DEFAULT STYLES - By Mahmoud Zalt (mahmoud@zalt.me) for Laradock.io
|
||||
*/
|
||||
|
||||
.project .logo img{
|
||||
width: 140px;
|
||||
height: 140px;
|
||||
background: transparent;
|
||||
border-radius: 0%;
|
||||
}
|
29
README.md
@ -1,29 +0,0 @@
|
||||
# Laradock
|
||||
|
||||
> Use Docker first and learn about it later.
|
||||
|
||||
[](http://zalt.me)
|
||||
|
||||
Laradock is a Docker PHP development environment that facilitate running **PHP** Apps on **Docker**.
|
||||
|
||||
## Documentation
|
||||
|
||||
[**Full Documentation Here**](http://laradock.io)
|
||||
|
||||
## Credits
|
||||
|
||||
**Super Admins:**
|
||||
|
||||
- [Mahmoud Zalt](https://github.com/Mahmoudz) (mahmoudz) [ [Twitter](https://twitter.com/Mahmoud_Zalt) | [Personal Site](http://zalt.me) | [LinkedIn](https://www.linkedin.com/in/mahmoudzalt) ]
|
||||
- [Bo-Yi Wu](https://github.com/appleboy) (appleboy) [ [Twitter](https://twitter.com/appleboy) ]
|
||||
- [Philippe Trépanier](https://github.com/philtrep) (philtrep)
|
||||
- [Mike Erickson](https://github.com/mikeerickson) (mikeerickson)
|
||||
- Join Us!
|
||||
|
||||
**Amazing Contributors:**
|
||||
|
||||
- [Contributors](https://github.com/laradock/laradock/graphs/contributors)
|
||||
|
||||
## License
|
||||
|
||||
[MIT License](https://github.com/laradock/laradock/blob/master/LICENSE) (MIT)
|
@ -1,213 +0,0 @@
|
||||
#### Install Docker
|
||||
```
|
||||
Login Digital Ocean
|
||||
Add Droplet
|
||||
1 Click Install docker
|
||||
Choose Droplet
|
||||
reset ROOT password
|
||||
check email
|
||||
```
|
||||
|
||||
#### SSH to your Server
|
||||
|
||||
```
|
||||
ssh root@ipaddress
|
||||
```
|
||||
you will be prompt of that password.
|
||||
type the password you receive in your email
|
||||
|
||||
then it will ask to you to change a new password
|
||||
just change it to the custom root password you want
|
||||
|
||||
After SSH
|
||||
you can check that docker command is working by typing
|
||||
|
||||
```
|
||||
$root@midascode:~# docker
|
||||
```
|
||||
|
||||
#### Set Up Your Laravel Project
|
||||
|
||||
```
|
||||
$root@midascode:~# apt-get install git
|
||||
$root@midascode:~# git clone https://github.com/laravel/laravel
|
||||
$root@midascode:~# cd laravel
|
||||
$root@midascode:~/laravel/ git submodule add https://github.com/LaraDock/laradock.git
|
||||
$root@midascode:~/laravel/ cd laradock
|
||||
```
|
||||
|
||||
#### Install docker-compose command
|
||||
|
||||
```
|
||||
$root@midascode:~/laravel/laradock# curl -L https://github.com/docker/compose/releases/download/1.8.0/run.sh > /usr/local/bin/docker-compose
|
||||
$root@midascode:~/chmod +x /usr/local/bin/docker-compose
|
||||
```
|
||||
|
||||
#### Create Your LaraDock Containers
|
||||
|
||||
```
|
||||
$root@midascode:~/laravel/laradock# docker-compose up -d nginx mysql
|
||||
```
|
||||
|
||||
#### Go to Your Workspace
|
||||
|
||||
```
|
||||
docker-compose exec workspace bash
|
||||
```
|
||||
|
||||
#### Install laravel Dependencies, Add .env , generate Key and give proper permission certain folder
|
||||
|
||||
```
|
||||
$ root@0e77851d27d3:/var/www# composer install
|
||||
$ root@0e77851d27d3:/var/www# cp .env.example .env
|
||||
$ root@0e77851d27d3:/var/www# php artisan key:generate
|
||||
$ root@0e77851d27d3:/var/www# exit
|
||||
$root@midascode:~/laravel/laradock# cd ..
|
||||
$root@midascode:~/laravel# sudo chmod -R 777 storage bootstrap/cache
|
||||
```
|
||||
|
||||
you can then view your laravel site at your ipaddress
|
||||
for example
|
||||
```
|
||||
192.168.1.1
|
||||
```
|
||||
|
||||
You will see there Laravel Default Welcome Page
|
||||
|
||||
but if you need to view on your custom domain name
|
||||
which you would.
|
||||
|
||||
#### Using Your Own Domain Name
|
||||
login to your DNS provider
|
||||
Godaddy, Namecheap what ever...
|
||||
And Point the Custom Domain Name Server to
|
||||
|
||||
```
|
||||
ns1.digitalocean.com
|
||||
ns2.digitalocean.com
|
||||
ns3.digitalocean.com
|
||||
```
|
||||
In Your Digital Ocean Account go to
|
||||
```
|
||||
https://cloud.digitalocean.com/networking/domains
|
||||
```
|
||||
add your domain name and choose the server ip you provision earlier
|
||||
|
||||
#### Serve Site With NGINX (HTTP ONLY)
|
||||
Go back to command line
|
||||
```
|
||||
$root@midascode:~/laravel/laradock# cd nginx
|
||||
$root@midascode:~/laravel/laradock/nginx# vim laravel.conf
|
||||
```
|
||||
remove default_server
|
||||
```
|
||||
|
||||
listen 80 default_server;
|
||||
listen [::]:80 default_server ipv6only=on;
|
||||
|
||||
```
|
||||
and add server_name (your custom domain)
|
||||
```
|
||||
listen 80;
|
||||
listen [::]:80 ipv6only=on;
|
||||
server_name yourdomain.com;
|
||||
```
|
||||
|
||||
#### Rebuild Your Nginx
|
||||
```
|
||||
$root@midascode:~/laravel/laradock/nginx# docker-compose down
|
||||
$root@midascode:~/laravel/laradock/nginx# docker-compose build nginx
|
||||
```
|
||||
|
||||
#### Re Run Your Containers MYSQL and NGINX
|
||||
```
|
||||
$root@midascode:~/laravel/laradock/nginx# docker-compose up -d nginx mysql
|
||||
```
|
||||
|
||||
###### View Your Site with HTTP ONLY (http://yourdomain.com)
|
||||
|
||||
#### Run Site on SSL with Let's Encrypt Certificate
|
||||
|
||||
###### Note: You need to Use Caddy here Instead of Nginx
|
||||
|
||||
###### To go Caddy Folders and Edit CaddyFile
|
||||
|
||||
```
|
||||
$root@midascode:~/laravel/laradock# cd caddy
|
||||
$root@midascode:~/laravel/laradock/caddy# vim Caddyfile
|
||||
```
|
||||
|
||||
Remove 0.0.0.0:80
|
||||
|
||||
```
|
||||
0.0.0.0:80
|
||||
root /var/www/public
|
||||
```
|
||||
and replace with your https://yourdomain.com
|
||||
|
||||
```
|
||||
https://yourdomain.com
|
||||
root /var/www/public
|
||||
```
|
||||
uncomment tls
|
||||
|
||||
```
|
||||
#tls self-signed
|
||||
```
|
||||
and replace self-signed with your email address
|
||||
|
||||
```
|
||||
tls midascodebreaker@gmai.com
|
||||
```
|
||||
This is needed Prior to Creating Let's Encypt
|
||||
|
||||
#### Run Your Caddy Container without the -d flag and Generate SSL with Let's Encrypt
|
||||
|
||||
```
|
||||
$root@midascode:~/laravel/laradock/caddy# docker-compose up caddy
|
||||
```
|
||||
|
||||
you will be prompt here to enter your email... you may enter it or not
|
||||
```
|
||||
Attaching to laradock_mysql_1, laradock_caddy_1
|
||||
caddy_1 | Activating privacy features...
|
||||
caddy_1 | Your sites will be served over HTTPS automatically using Let's Encrypt.
|
||||
caddy_1 | By continuing, you agree to the Let's Encrypt Subscriber Agreement at:
|
||||
caddy_1 | https://letsencrypt.org/documents/LE-SA-v1.0.1-July-27-2015.pdf
|
||||
caddy_1 | Activating privacy features... done.
|
||||
caddy_1 | https://yourdomain.com
|
||||
caddy_1 | http://yourdomain.com
|
||||
```
|
||||
|
||||
After it finish Press Ctrl + C to exit ...
|
||||
|
||||
#### Stop All Containers and ReRun Caddy and Other Containers on Background
|
||||
|
||||
```
|
||||
$root@midascode:~/laravel/laradock/caddy# docker-compose down
|
||||
$root@midascode:~/laravel/laradock/caddy# docker-compose up -d mysql caddy
|
||||
```
|
||||
View your Site in the Browser Securely Using HTTPS (https://yourdomain.com)
|
||||
|
||||
##### Note that Certificate will be Automatically Renew By Caddy
|
||||
|
||||
>References:
|
||||
>
|
||||
- [https://www.digitalocean.com/community/tutorials/how-to-install-and-use-docker-on-ubuntu-16-04](https://www.digitalocean.com/community/tutorials/how-to-install-and-use-docker-on-ubuntu-16-04)
|
||||
- [https://www.digitalocean.com/products/one-click-apps/docker/](https://www.digitalocean.com/products/one-click-apps/docker/)
|
||||
- [https://docs.docker.com/engine/installation/linux/ubuntulinux/](https://docs.docker.com/engine/installation/linux/ubuntulinux/)
|
||||
- [https://docs.docker.com/compose/install/](https://docs.docker.com/compose/install/)
|
||||
- [https://caddyserver.com/docs/automatic-https](https://caddyserver.com/docs/automatic-https)
|
||||
- [https://caddyserver.com/docs/tls](https://caddyserver.com/docs/tls)
|
||||
- [https://caddyserver.com/docs/caddyfile](https://caddyserver.com/docs/caddyfile)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -1,302 +0,0 @@
|
||||
# PHPStorm Debugging Guide
|
||||
|
||||
- [Intro](#Intro)
|
||||
- [Installation](#Installation)
|
||||
- [Customize laradock/docker-compose.yml](#CustomizeDockerCompose)
|
||||
- [Clean House](#InstallCleanHouse)
|
||||
- [LaraDock Dial Tone](#InstallLaraDockDialTone)
|
||||
- [hosts](#AddToHosts)
|
||||
- [Firewall](#FireWall)
|
||||
- [Enable xDebug on php-fpm](#enablePhpXdebug)
|
||||
- [PHPStorm Settings](#InstallPHPStorm)
|
||||
- [Configs](#InstallPHPStormConfigs)
|
||||
- [Usage](#Usage)
|
||||
- [Laravel](#UsageLaravel)
|
||||
- [Run ExampleTest](#UsagePHPStormRunExampleTest)
|
||||
- [Debug ExampleTest](#UsagePHPStormDebugExampleTest)
|
||||
- [Debug Web Site](#UsagePHPStormDebugSite)
|
||||
- [SSH into workspace](#SSHintoWorkspace)
|
||||
- [KiTTY](#InstallKiTTY)
|
||||
|
||||
<a name="Intro"></a>
|
||||
## Intro
|
||||
|
||||
Wiring up [Laravel](https://laravel.com/), [LaraDock](https://github.com/LaraDock/laradock) [Laravel+Docker] and [PHPStorm](https://www.jetbrains.com/phpstorm/) to play nice together complete with remote xdebug'ing as icing on top! Although this guide is based on `PHPStorm Windows`,
|
||||
you should be able to adjust accordingly. This guide was written based on Docker for Windows Native.
|
||||
|
||||
<a name="Installation"></a>
|
||||
## Installation
|
||||
|
||||
- This guide assumes the following:
|
||||
- you have already installed and are familiar with Laravel, LaraDock and PHPStorm.
|
||||
- you have installed Laravel as a parent of `laradock`. This guide assumes `/c/_dk/laravel`.
|
||||
|
||||
<a name="AddToHosts"></a>
|
||||
## hosts
|
||||
- Add `laravel` to your hosts file located on Windows 10 at `C:\Windows\System32\drivers\etc\hosts`. It should be set to the IP of your running container. Mine is: `10.0.75.2`
|
||||
On Windows you can find it by opening Windows `Hyper-V Manager`.
|
||||
- 
|
||||
|
||||
- [Hosts File Editor](https://github.com/scottlerch/HostsFileEditor) makes it easy to change your hosts file.
|
||||
- Set `laravel` to your docker host IP. See [Example](photos/SimpleHostsEditor/AddHost_laravel.png).
|
||||
|
||||
|
||||
<a name="FireWall"></a>
|
||||
## Firewall
|
||||
Your PHPStorm will need to be able to receive a connection from PHP xdebug either your running workspace or php-fpm containers on port 9000. This means that your Windows Firewall should either enable connections from the Application PHPStorm OR the port.
|
||||
|
||||
- It is important to note that if the Application PHPStorm is NOT enabled in the firewall, you will not be able to recreate a rule to override that.
|
||||
- Also be aware that if you are installing/upgrade different versions of PHPStorm, you MAY have orphaned references to PHPStorm in your Firewall! You may decide to remove orphaned references however in either case, make sure that they are set to receive public TCP traffic.
|
||||
|
||||
### Edit laradock/docker-compose.yml
|
||||
Set the following variables:
|
||||
```
|
||||
### Workspace Utilities Container ###########################
|
||||
|
||||
workspace:
|
||||
build:
|
||||
context: ./workspace
|
||||
args:
|
||||
- INSTALL_XDEBUG=true
|
||||
- INSTALL_WORKSPACE_SSH=true
|
||||
...
|
||||
|
||||
|
||||
### PHP-FPM Container #######################################
|
||||
|
||||
php-fpm:
|
||||
build:
|
||||
context: ./php-fpm
|
||||
args:
|
||||
- INSTALL_XDEBUG=true
|
||||
...
|
||||
|
||||
```
|
||||
|
||||
### Edit xdebug.ini files
|
||||
- `laradock/workspace/xdebug.ini`
|
||||
- `laradock/php-fpm/xdebug.ini`
|
||||
|
||||
Set the following variables:
|
||||
```
|
||||
xdebug.remote_autostart=1
|
||||
xdebug.remote_enable=1
|
||||
xdebug.remote_connect_back=1
|
||||
xdebug.cli_color=1
|
||||
```
|
||||
|
||||
|
||||
<a name="InstallCleanHouse"></a>
|
||||
### Need to clean house first?
|
||||
Make sure you are starting with a clean state. For example, do you have other LaraDock containers and images?
|
||||
Here are a few things I use to clean things up.
|
||||
|
||||
- Delete all containers using `grep laradock_` on the names, see: [Remove all containers based on docker image name](https://linuxconfig.org/remove-all-containners-based-on-docker-image-name).
|
||||
`docker ps -a | awk '{ print $1,$2 }' | grep laradock_ | awk '{print $1}' | xargs -I {} docker rm {}`
|
||||
|
||||
- Delete all images containing `laradock`.
|
||||
`docker images | awk '{print $1,$2,$3}' | grep laradock_ | awk '{print $3}' | xargs -I {} docker rmi {}`
|
||||
**Note:** This will only delete images that were built with `LaraDock`, **NOT** `laradock/*` which are pulled down by `LaraDock` such as `laradock/workspace`, etc.
|
||||
**Note:** Some may fail with:
|
||||
`Error response from daemon: conflict: unable to delete 3f38eaed93df (cannot be forced) - image has dependent child images`
|
||||
|
||||
- I added this to my `.bashrc` to remove orphaned images.
|
||||
```
|
||||
dclean() {
|
||||
processes=`docker ps -q -f status=exited`
|
||||
if [ -n "$processes" ]; thend
|
||||
docker rm $processes
|
||||
fi
|
||||
|
||||
images=`docker images -q -f dangling=true`
|
||||
if [ -n "$images" ]; then
|
||||
docker rmi $images
|
||||
fi
|
||||
}
|
||||
```
|
||||
|
||||
- If you frequently switch configurations for LaraDock, you may find that adding the following and added to your `.bashrc` or equivalent useful:
|
||||
```
|
||||
# remove laravel* containers
|
||||
# remove laravel_* images
|
||||
dcleanlaradockfunction()
|
||||
{
|
||||
echo 'Removing ALL containers associated with laradock'
|
||||
docker ps -a | awk '{ print $1,$2 }' | grep laradock | awk '{print $1}' | xargs -I {} docker rm {}
|
||||
|
||||
# remove ALL images associated with laradock_
|
||||
# does NOT delete laradock/* which are hub images
|
||||
echo 'Removing ALL images associated with laradock_'
|
||||
docker images | awk '{print $1,$2,$3}' | grep laradock_ | awk '{print $3}' | xargs -I {} docker rmi {}
|
||||
|
||||
echo 'Listing all laradock docker hub images...'
|
||||
docker images | grep laradock
|
||||
|
||||
echo 'dcleanlaradock completed'
|
||||
}
|
||||
# associate the above function with an alias
|
||||
# so can recall/lookup by typing 'alias'
|
||||
alias dcleanlaradock=dcleanlaradockfunction
|
||||
```
|
||||
|
||||
<a name="InstallLaraDockDialTone"></a>
|
||||
#### Let's get a dial-tone with Laravel
|
||||
|
||||
```
|
||||
# barebones at this point
|
||||
docker-compose up -d nginx mysql
|
||||
|
||||
# run
|
||||
docker-compose ps
|
||||
|
||||
# Should see:
|
||||
Name Command State Ports
|
||||
-----------------------------------------------------------------------------------------------------------
|
||||
laradock_mysql_1 docker-entrypoint.sh mysqld Up 0.0.0.0:3306->3306/tcp
|
||||
laradock_nginx_1 nginx Up 0.0.0.0:443->443/tcp, 0.0.0.0:80->80/tcp
|
||||
laradock_php-fpm_1 php-fpm Up 9000/tcp
|
||||
laradock_volumes_data_1 true Exit 0
|
||||
laradock_volumes_source_1 true Exit 0
|
||||
laradock_workspace_1 /sbin/my_init Up 0.0.0.0:2222->22/tcp
|
||||
|
||||
|
||||
```
|
||||
|
||||
<a name="enablePhpXdebug"></a>
|
||||
#### Enable xDebug on php-fpm
|
||||
In a host terminal sitting in the laradock folder, run: `./xdebugPhpFpm status`
|
||||
You should see something like the following:
|
||||
```
|
||||
xDebug status
|
||||
laradock_php-fpm_1
|
||||
PHP 7.0.9 (cli) (built: Aug 10 2016 19:45:48) ( NTS )
|
||||
Copyright (c) 1997-2016 The PHP Group
|
||||
Zend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies
|
||||
with Xdebug v2.4.1, Copyright (c) 2002-2016, by Derick Rethans
|
||||
```
|
||||
Other commands include `./xdebugPhpFpm start | stop`.
|
||||
|
||||
If you have enabled `xdebug=true` in `docker-compose.yml/php-fpm`, `xdebug` will already be running when
|
||||
`php-fpm` is started and listening for debug info on port 9000.
|
||||
|
||||
|
||||
<a name="InstallPHPStormConfigs"></a>
|
||||
#### PHPStorm Settings
|
||||
- Here are some settings that are known to work:
|
||||
- `Settings/BuildDeploymentConnection`
|
||||
- 
|
||||
|
||||
- `Settings/BuildDeploymentConnectionMappings`
|
||||
- 
|
||||
|
||||
- `Settings/BuildDeploymentDebugger`
|
||||
- 
|
||||
|
||||
- `Settings/EditRunConfigurationRemoteWebDebug`
|
||||
- 
|
||||
|
||||
- `Settings/EditRunConfigurationRemoteExampleTestDebug`
|
||||
- 
|
||||
|
||||
- `Settings/LangsPHPDebug`
|
||||
- 
|
||||
|
||||
- `Settings/LangsPHPInterpreters`
|
||||
- 
|
||||
|
||||
- `Settings/LangsPHPPHPUnit`
|
||||
- 
|
||||
|
||||
- `Settings/LangsPHPServers`
|
||||
- 
|
||||
|
||||
- `RemoteHost`
|
||||
To switch on this view, go to: `Menu/Tools/Deployment/Browse Remote Host`.
|
||||
- 
|
||||
|
||||
- `RemoteWebDebug`
|
||||
- 
|
||||
|
||||
- `EditRunConfigurationRemoteWebDebug`
|
||||
Go to: `Menu/Run/Edit Configurations`.
|
||||
- 
|
||||
|
||||
- `EditRunConfigurationRemoteExampleTestDebug`
|
||||
Go to: `Menu/Run/Edit Configurations`.
|
||||
- 
|
||||
|
||||
- `WindowsFirewallAllowedApps`
|
||||
Go to: `Control Panel\All Control Panel Items\Windows Firewall\Allowed apps`.
|
||||
- 
|
||||
|
||||
- `hosts`
|
||||
Edit: `C:\Windows\System32\drivers\etc\hosts`.
|
||||
- 
|
||||
|
||||
- [Enable xDebug on php-fpm](#enablePhpXdebug)
|
||||
|
||||
|
||||
|
||||
<a name="Usage"></a>
|
||||
## Usage
|
||||
|
||||
<a name="UsagePHPStormRunExampleTest"></a>
|
||||
### Run ExampleTest
|
||||
- right-click on `tests/ExampleTest.php`
|
||||
- Select: `Run 'ExampleTest.php'` or `Ctrl+Shift+F10`.
|
||||
- Should pass!! You just ran a remote test via SSH!
|
||||
|
||||
<a name="UsagePHPStormDebugExampleTest"></a>
|
||||
### Debug ExampleTest
|
||||
- Open to edit: `tests/ExampleTest.php`
|
||||
- Add a BreakPoint on line 16: `$this->visit('/')`
|
||||
- right-click on `tests/ExampleTest.php`
|
||||
- Select: `Debug 'ExampleTest.php'`.
|
||||
- Should have stopped at the BreakPoint!! You are now debugging locally against a remote Laravel project via SSH!
|
||||
- 
|
||||
|
||||
|
||||
<a name="UsagePHPStormDebugSite"></a>
|
||||
### Debug WebSite
|
||||
- In case xDebug is disabled, from the `laradock` folder run:
|
||||
`./xdebugPhpFpm start`.
|
||||
- To switch xdebug off, run:
|
||||
`./xdebugPhpFpm stop`
|
||||
|
||||
- Start Remote Debugging
|
||||
- 
|
||||
|
||||
- Open to edit: `bootstrap/app.php`
|
||||
- Add a BreakPoint on line 14: `$app = new Illuminate\Foundation\Application(`
|
||||
- Reload [Laravel Site](http://laravel/)
|
||||
- Should have stopped at the BreakPoint!! You are now debugging locally against a remote Laravel project via SSH!
|
||||
- 
|
||||
|
||||
|
||||
<a name="SSHintoWorkspace"></a>
|
||||
#### Let's shell into workspace
|
||||
Assuming that you are in laradock folder, type:
|
||||
`ssh -i workspace/insecure_id_rsa -p2222 root@laravel`
|
||||
**Cha Ching!!!!**
|
||||
- `workspace/insecure_id_rsa.ppk` may become corrupted. In which case:
|
||||
- fire up `puttygen`
|
||||
- import `workspace/insecure_id_rsa`
|
||||
- save private key to `workspace/insecure_id_rsa.ppk`
|
||||
|
||||
<a name="InstallKiTTY"></a>
|
||||
|
||||
##### KiTTY
|
||||
[Kitty](http://www.9bis.net/kitty/) KiTTY is a fork from version 0.67 of PuTTY.
|
||||
|
||||
- Here are some settings that are working for me:
|
||||
- 
|
||||
- 
|
||||
- 
|
||||
- 
|
||||
- 
|
||||
- 
|
||||
- 
|
||||
- 
|
||||
- 
|
||||
|
||||
|
29
adminer/Dockerfile
Normal file
@ -0,0 +1,29 @@
|
||||
FROM adminer:4.3.0
|
||||
|
||||
# Version 4.3.1 contains PostgreSQL login errors. See docs.
|
||||
# See https://sourceforge.net/p/adminer/bugs-and-features/548/
|
||||
|
||||
MAINTAINER Patrick Artounian <partounian@gmail.com>
|
||||
|
||||
# Add volume for sessions to allow session persistence
|
||||
VOLUME /sessions
|
||||
|
||||
#####################################
|
||||
# SQL SERVER:
|
||||
#####################################
|
||||
USER root
|
||||
ARG INSTALL_MSSQL=false
|
||||
ENV INSTALL_MSSQL ${INSTALL_MSSQL}
|
||||
RUN if [ ${INSTALL_MSSQL} = true ]; then \
|
||||
set -xe \
|
||||
&& apk --update add --no-cache --virtual .phpize-deps $PHPIZE_DEPS unixodbc unixodbc-dev \
|
||||
&& pecl channel-update pecl.php.net \
|
||||
&& pecl install pdo_sqlsrv-4.1.8preview sqlsrv-4.1.8preview \
|
||||
&& echo "extension=sqlsrv.so" > /usr/local/etc/php/conf.d/20-sqlsrv.ini \
|
||||
&& echo "extension=pdo_sqlsrv.so" > /usr/local/etc/php/conf.d/20-pdo_sqlsrv.ini \
|
||||
;fi
|
||||
|
||||
USER adminer
|
||||
|
||||
# We expose Adminer on port 8080 (Adminer's default)
|
||||
EXPOSE 8080
|
@ -2,15 +2,21 @@ FROM webdevops/apache:ubuntu-16.04
|
||||
|
||||
MAINTAINER Eric Pfeiffer <computerfr33k@users.noreply.github.com>
|
||||
|
||||
ARG PHP_SOCKET=php-fpm:9000
|
||||
ARG PHP_UPSTREAM_CONTAINER=php-fpm
|
||||
ARG PHP_UPSTREAM_PORT=9000
|
||||
ARG PHP_UPSTREAM_TIMEOUT=60
|
||||
|
||||
ENV WEB_PHP_SOCKET=$PHP_SOCKET
|
||||
ENV WEB_PHP_SOCKET=${PHP_UPSTREAM_CONTAINER}:${PHP_UPSTREAM_PORT}
|
||||
|
||||
ENV WEB_DOCUMENT_ROOT=/var/www/public
|
||||
ENV WEB_DOCUMENT_ROOT=/var/www/
|
||||
|
||||
ENV WEB_PHP_TIMEOUT=${PHP_UPSTREAM_TIMEOUT}
|
||||
|
||||
EXPOSE 80 443
|
||||
|
||||
WORKDIR /var/www/public
|
||||
WORKDIR /var/www/
|
||||
|
||||
COPY vhost.conf /etc/apache2/sites-enabled/vhost.conf
|
||||
|
||||
ENTRYPOINT ["/opt/docker/bin/entrypoint.sh"]
|
||||
|
||||
|
3
apache2/sites/.gitignore
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
*.conf
|
||||
!default.conf
|
||||
!default.apache.conf
|
16
apache2/sites/default.apache.conf
Normal file
@ -0,0 +1,16 @@
|
||||
<VirtualHost *:80>
|
||||
ServerName laradock.dev
|
||||
DocumentRoot /var/www/
|
||||
Options Indexes FollowSymLinks
|
||||
|
||||
<Directory "/var/www/">
|
||||
AllowOverride All
|
||||
<IfVersion < 2.4>
|
||||
Allow from all
|
||||
</IfVersion>
|
||||
<IfVersion >= 2.4>
|
||||
Require all granted
|
||||
</IfVersion>
|
||||
</Directory>
|
||||
|
||||
</VirtualHost>
|
16
apache2/sites/sample.conf.example
Normal file
@ -0,0 +1,16 @@
|
||||
<VirtualHost *:80>
|
||||
ServerName sample.dev
|
||||
DocumentRoot /var/www/sample/public/
|
||||
Options Indexes FollowSymLinks
|
||||
|
||||
<Directory "/var/www/sample/public/">
|
||||
AllowOverride All
|
||||
<IfVersion < 2.4>
|
||||
Allow from all
|
||||
</IfVersion>
|
||||
<IfVersion >= 2.4>
|
||||
Require all granted
|
||||
</IfVersion>
|
||||
</Directory>
|
||||
|
||||
</VirtualHost>
|
1
apache2/vhost.conf
Normal file
@ -0,0 +1 @@
|
||||
Include /etc/apache2/sites-available/*.conf
|
1
aws/.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
./ssh_keys
|
17
aws/Dockerfile
Normal file
@ -0,0 +1,17 @@
|
||||
FROM python:slim
|
||||
|
||||
MAINTAINER melchabcede@gmail.com
|
||||
|
||||
RUN pip install --upgrade --no-cache-dir awsebcli
|
||||
RUN apt-get -yqq update && apt-get -yqq install git-all
|
||||
|
||||
#NOTE: make sure ssh keys are added to ssh_keys folder
|
||||
|
||||
RUN mkdir root/tmp_ssh
|
||||
COPY /ssh_keys/. /root/.ssh/
|
||||
RUN cd /root/.ssh && chmod 600 * && chmod 644 *.pub
|
||||
|
||||
# Set default work directory
|
||||
WORKDIR /var/www
|
||||
|
||||
|
@ -1,28 +1,30 @@
|
||||
# Docs: https://caddyserver.com/docs/caddyfile
|
||||
0.0.0.0:80
|
||||
root /var/www/public
|
||||
fastcgi / php-fpm:9000 php {
|
||||
index index.php
|
||||
0.0.0.0:80 {
|
||||
root /var/www/public
|
||||
fastcgi / php-fpm:9000 php {
|
||||
index index.php
|
||||
}
|
||||
|
||||
# To handle .html extensions with laravel change ext to
|
||||
# ext / .html
|
||||
|
||||
rewrite {
|
||||
to {path} {path}/ /index.php?{query}
|
||||
}
|
||||
gzip
|
||||
browse
|
||||
log /var/log/caddy/access.log
|
||||
errors /var/log/caddy/error.log
|
||||
# Uncomment to enable TLS (HTTPS)
|
||||
# Change the first list to listen on port 443 when enabling TLS
|
||||
#tls self_signed
|
||||
|
||||
# To use Lets encrpt tls with a DNS provider uncomment these
|
||||
# lines and change the provider as required
|
||||
#tls {
|
||||
# dns cloudflare
|
||||
#}
|
||||
}
|
||||
|
||||
# To handle .html extensions with laravel change ext to
|
||||
# ext / .html
|
||||
|
||||
rewrite {
|
||||
r .*
|
||||
ext /
|
||||
to /index.php?{query}
|
||||
laradock.demo {
|
||||
root /var/www/public
|
||||
}
|
||||
gzip
|
||||
browse
|
||||
log /var/log/caddy/access.log
|
||||
errors /var/log/caddy/error.log
|
||||
# Uncomment to enable TLS (HTTPS)
|
||||
# Change the first list to listen on port 443 when enabling TLS
|
||||
#tls self_signed
|
||||
|
||||
# To use Lets encrpt tls with a DNS provider uncomment these
|
||||
# lines and change the provider as required
|
||||
#tls {
|
||||
# dns cloudflare
|
||||
#}
|
||||
|
@ -1,18 +1,19 @@
|
||||
FROM alpine:3.4
|
||||
FROM alpine:3.5
|
||||
|
||||
MAINTAINER Eric Pfeiffer <computerfr33k@users.noreply.github.com>
|
||||
|
||||
ENV caddy_version=0.9.5
|
||||
ENV caddy_version=0.10.5
|
||||
ARG plugins=http.git
|
||||
|
||||
LABEL caddy_version="$caddy_version" architecture="amd64"
|
||||
|
||||
RUN apk update \
|
||||
&& apk upgrade \
|
||||
&& apk add tar curl
|
||||
&& apk add --no-cache openssh-client git tar curl
|
||||
|
||||
RUN curl --silent --show-error --fail --location \
|
||||
--header "Accept: application/tar+gzip, application/x-gzip, application/octet-stream" -o - \
|
||||
"https://caddyserver.com/download/build?os=linux&arch=amd64&features=cloudflare%2Cdigitalocean%2Cdnsimple%2Cdyn%2Cgooglecloud%2Clinode%2Croute53" \
|
||||
"https://caddyserver.com/download/linux/amd64?plugins=${plugins}" \
|
||||
| tar --no-same-owner -C /usr/bin/ -xz caddy \
|
||||
&& mv /usr/bin/caddy /usr/bin/caddy \
|
||||
&& chmod 0755 /usr/bin/caddy
|
||||
@ -21,4 +22,4 @@ EXPOSE 80 443 2015
|
||||
|
||||
WORKDIR /var/www/public
|
||||
|
||||
CMD ["/usr/bin/caddy", "-conf", "/etc/Caddyfile"]
|
||||
CMD ["/usr/bin/caddy", "-conf", "/etc/Caddyfile"]
|
||||
|
10
certbot/Dockerfile
Normal file
@ -0,0 +1,10 @@
|
||||
FROM phusion/baseimage:latest
|
||||
|
||||
MAINTAINER Mahmoud Zalt <mahmoud@zalt.me>
|
||||
|
||||
COPY run-certbot.sh /root/certbot/run-certbot.sh
|
||||
|
||||
RUN apt-get update
|
||||
RUN apt-get install -y letsencrypt
|
||||
|
||||
ENTRYPOINT bash -c "bash /root/certbot/run-certbot.sh && sleep infinity"
|
6
certbot/run-certbot.sh
Normal file
@ -0,0 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
letsencrypt certonly --webroot -w /var/www/letsencrypt -d "$CN" --agree-tos --email "$EMAIL" --non-interactive --text
|
||||
|
||||
cp /etc/letsencrypt/archive/"$CN"/cert1.pem /var/certs/cert1.pem
|
||||
cp /etc/letsencrypt/archive/"$CN"/privkey1.pem /var/certs/privkey1.pem
|
17
docker-compose.sync.yml
Normal file
@ -0,0 +1,17 @@
|
||||
version: '2'
|
||||
|
||||
services:
|
||||
|
||||
### Applications Code Container #############################
|
||||
|
||||
applications:
|
||||
image: tianon/true
|
||||
volumes:
|
||||
- applications-sync:/var/www:nocopy # nocopy is required
|
||||
|
||||
### Volumes Setup #############################################
|
||||
|
||||
volumes:
|
||||
applications-sync:
|
||||
external:
|
||||
name: "applications-docker-sync"
|
@ -5,384 +5,695 @@ services:
|
||||
### Applications Code Container #############################
|
||||
|
||||
applications:
|
||||
image: tianon/true
|
||||
volumes:
|
||||
- ../:/var/www
|
||||
# - ../sample/:/var/www/sample
|
||||
image: tianon/true
|
||||
volumes:
|
||||
- ${APPLICATION}:/var/www
|
||||
|
||||
### Workspace Utilities Container ###########################
|
||||
|
||||
workspace:
|
||||
build:
|
||||
context: ./workspace
|
||||
args:
|
||||
- INSTALL_XDEBUG=false
|
||||
- INSTALL_SOAP=false
|
||||
- INSTALL_MONGO=false
|
||||
- INSTALL_NODE=false
|
||||
- INSTALL_YARN=false
|
||||
- INSTALL_DRUSH=false
|
||||
- INSTALL_AEROSPIKE_EXTENSION=false
|
||||
- INSTALL_V8JS_EXTENSION=false
|
||||
- COMPOSER_GLOBAL_INSTALL=false
|
||||
- INSTALL_WORKSPACE_SSH=false
|
||||
- INSTALL_LARAVEL_ENVOY=false
|
||||
- INSTALL_DEPLOYER=false
|
||||
- INSTALL_LINUXBREW=false
|
||||
- INSTALL_MC=false
|
||||
- PUID=1000
|
||||
- PGID=1000
|
||||
- NODE_VERSION=stable
|
||||
- YARN_VERSION=latest
|
||||
- TZ=UTC
|
||||
volumes_from:
|
||||
- applications
|
||||
extra_hosts:
|
||||
# IMPORTANT: Replace with your Docker Host IP (will be appended to /etc/hosts)
|
||||
- "dockerhost:10.0.75.1"
|
||||
ports:
|
||||
- "2222:22"
|
||||
tty: true
|
||||
build:
|
||||
context: ./workspace
|
||||
args:
|
||||
- INSTALL_XDEBUG=${WORKSPACE_INSTALL_XDEBUG}
|
||||
- INSTALL_BLACKFIRE=${INSTALL_BLACKFIRE}
|
||||
- INSTALL_SOAP=${WORKSPACE_INSTALL_SOAP}
|
||||
- INSTALL_LDAP=${WORKSPACE_INSTALL_LDAP}
|
||||
- INSTALL_MONGO=${WORKSPACE_INSTALL_MONGO}
|
||||
- INSTALL_PHPREDIS=${WORKSPACE_INSTALL_PHPREDIS}
|
||||
- INSTALL_MSSQL=${WORKSPACE_INSTALL_MSSQL}
|
||||
- INSTALL_NODE=${WORKSPACE_INSTALL_NODE}
|
||||
- INSTALL_YARN=${WORKSPACE_INSTALL_YARN}
|
||||
- INSTALL_DRUSH=${WORKSPACE_INSTALL_DRUSH}
|
||||
- INSTALL_DRUPAL_CONSOLE=${WORKSPACE_INSTALL_DRUPAL_CONSOLE}
|
||||
- INSTALL_AEROSPIKE=${WORKSPACE_INSTALL_AEROSPIKE}
|
||||
- INSTALL_V8JS=${WORKSPACE_INSTALL_V8JS}
|
||||
- COMPOSER_GLOBAL_INSTALL=${WORKSPACE_COMPOSER_GLOBAL_INSTALL}
|
||||
- INSTALL_WORKSPACE_SSH=${WORKSPACE_INSTALL_WORKSPACE_SSH}
|
||||
- INSTALL_LARAVEL_ENVOY=${WORKSPACE_INSTALL_LARAVEL_ENVOY}
|
||||
- INSTALL_LARAVEL_INSTALLER=${WORKSPACE_INSTALL_LARAVEL_INSTALLER}
|
||||
- INSTALL_DEPLOYER=${WORKSPACE_INSTALL_DEPLOYER}
|
||||
- INSTALL_LINUXBREW=${WORKSPACE_INSTALL_LINUXBREW}
|
||||
- INSTALL_MC=${WORKSPACE_INSTALL_MC}
|
||||
- INSTALL_SYMFONY=${WORKSPACE_INSTALL_SYMFONY}
|
||||
- INSTALL_PYTHON=${WORKSPACE_INSTALL_PYTHON}
|
||||
- INSTALL_IMAGE_OPTIMIZERS=${WORKSPACE_INSTALL_IMAGE_OPTIMIZERS}
|
||||
- INSTALL_IMAGEMAGICK=${WORKSPACE_INSTALL_IMAGEMAGICK}
|
||||
- INSTALL_TERRAFORM=${WORKSPACE_INSTALL_TERRAFORM}
|
||||
- INSTALL_DUSK_DEPS=${WORKSPACE_INSTALL_DUSK_DEPS}
|
||||
- PUID=${WORKSPACE_PUID}
|
||||
- PGID=${WORKSPACE_PGID}
|
||||
- CHROME_DRIVER_VERSION=${WORKSPACE_CHROME_DRIVER_VERSION}
|
||||
- NODE_VERSION=${WORKSPACE_NODE_VERSION}
|
||||
- YARN_VERSION=${WORKSPACE_YARN_VERSION}
|
||||
- TZ=${WORKSPACE_TIMEZONE}
|
||||
- BLACKFIRE_CLIENT_ID=${BLACKFIRE_CLIENT_ID}
|
||||
- BLACKFIRE_CLIENT_TOKEN=${BLACKFIRE_CLIENT_TOKEN}
|
||||
dockerfile: "Dockerfile-${PHP_VERSION}"
|
||||
volumes_from:
|
||||
- applications
|
||||
extra_hosts:
|
||||
- "dockerhost:${DOCKER_HOST_IP}"
|
||||
ports:
|
||||
- "${WORKSPACE_SSH_PORT}:22"
|
||||
tty: true
|
||||
networks:
|
||||
- frontend
|
||||
- backend
|
||||
|
||||
### PHP-FPM Container #######################################
|
||||
|
||||
php-fpm:
|
||||
build:
|
||||
context: ./php-fpm
|
||||
args:
|
||||
- INSTALL_XDEBUG=false
|
||||
- INSTALL_SOAP=false
|
||||
- INSTALL_MONGO=false
|
||||
- INSTALL_ZIP_ARCHIVE=false
|
||||
- INSTALL_BCMATH=false
|
||||
- INSTALL_PHPREDIS=false
|
||||
- INSTALL_MEMCACHED=false
|
||||
- INSTALL_OPCACHE=false
|
||||
- INSTALL_EXIF=false
|
||||
- INSTALL_AEROSPIKE_EXTENSION=false
|
||||
- CODEIGNITER=false
|
||||
dockerfile: Dockerfile-70
|
||||
volumes_from:
|
||||
- applications
|
||||
expose:
|
||||
- "9000"
|
||||
links:
|
||||
- workspace
|
||||
extra_hosts:
|
||||
# IMPORTANT: Replace with your Docker Host IP (will be appended to /etc/hosts)
|
||||
- "dockerhost:10.0.75.1"
|
||||
environment:
|
||||
# IMPORTANT: Set the Remote Interpreter entry matching name to `laravel`
|
||||
- PHP_IDE_CONFIG=serverName=laravel
|
||||
build:
|
||||
context: ./php-fpm
|
||||
args:
|
||||
- INSTALL_XDEBUG=${PHP_FPM_INSTALL_XDEBUG}
|
||||
- INSTALL_BLACKFIRE=${INSTALL_BLACKFIRE}
|
||||
- INSTALL_SOAP=${PHP_FPM_INSTALL_SOAP}
|
||||
- INSTALL_MONGO=${PHP_FPM_INSTALL_MONGO}
|
||||
- INSTALL_MSSQL=${PHP_FPM_INSTALL_MSSQL}
|
||||
- INSTALL_ZIP_ARCHIVE=${PHP_FPM_INSTALL_ZIP_ARCHIVE}
|
||||
- INSTALL_BCMATH=${PHP_FPM_INSTALL_BCMATH}
|
||||
- INSTALL_PHPREDIS=${PHP_FPM_INSTALL_PHPREDIS}
|
||||
- INSTALL_MEMCACHED=${PHP_FPM_INSTALL_MEMCACHED}
|
||||
- INSTALL_OPCACHE=${PHP_FPM_INSTALL_OPCACHE}
|
||||
- INSTALL_EXIF=${PHP_FPM_INSTALL_EXIF}
|
||||
- INSTALL_AEROSPIKE=${PHP_FPM_INSTALL_AEROSPIKE}
|
||||
- INSTALL_MYSQLI=${PHP_FPM_INSTALL_MYSQLI}
|
||||
- INSTALL_TOKENIZER=${PHP_FPM_INSTALL_TOKENIZER}
|
||||
- INSTALL_INTL=${PHP_FPM_INSTALL_INTL}
|
||||
- INSTALL_GHOSTSCRIPT=${PHP_FPM_INSTALL_GHOSTSCRIPT}
|
||||
- INSTALL_LDAP=${PHP_FPM_INSTALL_LDAP}
|
||||
- INSTALL_SWOOLE=${PHP_FPM_INSTALL_SWOOLE}
|
||||
- INSTALL_IMAGE_OPTIMIZERS=${PHP_FPM_INSTALL_IMAGE_OPTIMIZERS}
|
||||
- INSTALL_IMAGEMAGICK=${PHP_FPM_INSTALL_IMAGEMAGICK}
|
||||
dockerfile: "Dockerfile-${PHP_VERSION}"
|
||||
volumes_from:
|
||||
- applications
|
||||
volumes:
|
||||
- ./php-fpm/php${PHP_VERSION}.ini:/usr/local/etc/php/php.ini
|
||||
expose:
|
||||
- "9000"
|
||||
depends_on:
|
||||
- workspace
|
||||
extra_hosts:
|
||||
- "dockerhost:${DOCKER_HOST_IP}"
|
||||
environment:
|
||||
- PHP_IDE_CONFIG=${PHP_IDE_CONFIG}
|
||||
networks:
|
||||
- backend
|
||||
|
||||
### Nginx Server Container ##################################
|
||||
### PHP Worker Container #####################################
|
||||
|
||||
php-worker:
|
||||
build:
|
||||
context: ./php-worker
|
||||
dockerfile: "Dockerfile-${PHP_VERSION}"
|
||||
volumes_from:
|
||||
- applications
|
||||
depends_on:
|
||||
- workspace
|
||||
extra_hosts:
|
||||
- "dockerhost:${DOCKER_HOST_IP}"
|
||||
networks:
|
||||
- backend
|
||||
|
||||
### NGINX Server Container ##################################
|
||||
|
||||
nginx:
|
||||
build:
|
||||
context: ./nginx
|
||||
args:
|
||||
- PHP_UPSTREAM=php-fpm
|
||||
volumes_from:
|
||||
- applications
|
||||
volumes:
|
||||
- ./logs/nginx/:/var/log/nginx
|
||||
- ./nginx/sites/:/etc/nginx/sites-available
|
||||
ports:
|
||||
- "80:80"
|
||||
- "443:443"
|
||||
links:
|
||||
- php-fpm
|
||||
build:
|
||||
context: ./nginx
|
||||
args:
|
||||
- PHP_UPSTREAM_CONTAINER=${NGINX_PHP_UPSTREAM_CONTAINER}
|
||||
- PHP_UPSTREAM_PORT=${NGINX_PHP_UPSTREAM_PORT}
|
||||
volumes_from:
|
||||
- applications
|
||||
volumes:
|
||||
- ${NGINX_HOST_LOG_PATH}:/var/log/nginx
|
||||
- ${NGINX_SITES_PATH}:/etc/nginx/sites-available
|
||||
ports:
|
||||
- "${NGINX_HOST_HTTP_PORT}:80"
|
||||
- "${NGINX_HOST_HTTPS_PORT}:443"
|
||||
depends_on:
|
||||
- php-fpm
|
||||
networks:
|
||||
- frontend
|
||||
- backend
|
||||
|
||||
### Blackfire Container #################################
|
||||
|
||||
blackfire:
|
||||
image: blackfire/blackfire
|
||||
environment:
|
||||
- BLACKFIRE_SERVER_ID=${BLACKFIRE_SERVER_ID}
|
||||
- BLACKFIRE_SERVER_TOKEN=${BLACKFIRE_SERVER_TOKEN}
|
||||
depends_on:
|
||||
- php-fpm
|
||||
networks:
|
||||
- backend
|
||||
|
||||
### Apache Server Container #################################
|
||||
|
||||
apache2:
|
||||
build:
|
||||
context: ./apache2
|
||||
args:
|
||||
- PHP_SOCKET=php-fpm:9000
|
||||
volumes_from:
|
||||
- applications
|
||||
volumes:
|
||||
- ./logs/apache2:/var/log/apache2
|
||||
ports:
|
||||
- "80:80"
|
||||
- "443:443"
|
||||
links:
|
||||
- php-fpm
|
||||
build:
|
||||
context: ./apache2
|
||||
args:
|
||||
- PHP_UPSTREAM_CONTAINER=${APACHE_PHP_UPSTREAM_CONTAINER}
|
||||
- PHP_UPSTREAM_PORT=${APACHE_PHP_UPSTREAM_PORT}
|
||||
- PHP_UPSTREAM_TIMEOUT=${APACHE_PHP_UPSTREAM_TIMEOUT}
|
||||
volumes_from:
|
||||
- applications
|
||||
volumes:
|
||||
- ${APACHE_HOST_LOG_PATH}:/var/log/apache2
|
||||
- ${APACHE_SITES_PATH}:/etc/apache2/sites-available
|
||||
ports:
|
||||
- "${APACHE_HOST_HTTP_PORT}:80"
|
||||
- "${APACHE_HOST_HTTPS_PORT}:443"
|
||||
depends_on:
|
||||
- php-fpm
|
||||
networks:
|
||||
- frontend
|
||||
- backend
|
||||
|
||||
### HHVM Container ##########################################
|
||||
|
||||
hhvm:
|
||||
build: ./hhvm
|
||||
volumes_from:
|
||||
- applications
|
||||
expose:
|
||||
- "9000"
|
||||
links:
|
||||
- workspace
|
||||
build: ./hhvm
|
||||
volumes_from:
|
||||
- applications
|
||||
expose:
|
||||
- "9000"
|
||||
depends_on:
|
||||
- workspace
|
||||
networks:
|
||||
- frontend
|
||||
- backend
|
||||
|
||||
### Minio Container #########################################
|
||||
|
||||
minio:
|
||||
build: ./minio
|
||||
volumes:
|
||||
- minio:/export
|
||||
ports:
|
||||
- "9000:9000"
|
||||
environment:
|
||||
MINIO_ACCESS_KEY: access
|
||||
MINIO_SECRET_KEY: secretkey
|
||||
build: ./minio
|
||||
volumes:
|
||||
- minio:/export
|
||||
ports:
|
||||
- "${MINIO_PORT}:9000"
|
||||
environment:
|
||||
- MINIO_ACCESS_KEY=access
|
||||
- MINIO_SECRET_KEY=secretkey
|
||||
networks:
|
||||
- frontend
|
||||
|
||||
### MySQL Container #########################################
|
||||
|
||||
mysql:
|
||||
build:
|
||||
context: ./mysql
|
||||
args:
|
||||
- MYSQL_DATABASE=homestead
|
||||
- MYSQL_USER=homestead
|
||||
- MYSQL_PASSWORD=secret
|
||||
- MYSQL_ROOT_PASSWORD=root
|
||||
volumes:
|
||||
- mysql:/var/lib/mysql
|
||||
ports:
|
||||
- "3306:3306"
|
||||
build:
|
||||
context: ./mysql
|
||||
args:
|
||||
- MYSQL_VERSION=${MYSQL_VERSION}
|
||||
environment:
|
||||
- MYSQL_DATABASE=${MYSQL_DATABASE}
|
||||
- MYSQL_USER=${MYSQL_USER}
|
||||
- MYSQL_PASSWORD=${MYSQL_PASSWORD}
|
||||
- MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}
|
||||
- TZ=${WORKSPACE_TIMEZONE}
|
||||
volumes:
|
||||
- ${DATA_SAVE_PATH}/mysql:/var/lib/mysql
|
||||
- ${MYSQL_ENTRYPOINT_INITDB}:/docker-entrypoint-initdb.d
|
||||
ports:
|
||||
- "${MYSQL_PORT}:3306"
|
||||
networks:
|
||||
- backend
|
||||
|
||||
### Percona Container #########################################
|
||||
|
||||
percona:
|
||||
build:
|
||||
context: ./percona
|
||||
environment:
|
||||
- MYSQL_DATABASE=${PERCONA_DATABASE}
|
||||
- MYSQL_USER=${PERCONA_USER}
|
||||
- MYSQL_PASSWORD=${PERCONA_PASSWORD}
|
||||
- MYSQL_ROOT_PASSWORD=${PERCONA_ROOT_PASSWORD}
|
||||
volumes:
|
||||
- ${DATA_SAVE_PATH}/percona:/var/lib/mysql
|
||||
- ${PERCONA_ENTRYPOINT_INITDB}:/docker-entrypoint-initdb.d
|
||||
ports:
|
||||
- "${PERCONA_PORT}:3306"
|
||||
networks:
|
||||
- backend
|
||||
|
||||
### MSSQL Container #########################################
|
||||
|
||||
mssql:
|
||||
build:
|
||||
context: ./mssql
|
||||
environment:
|
||||
- MSSQL_DATABASE=${MSSQL_DATABASE}
|
||||
- SA_PASSWORD=${MSSQL_PASSWORD}
|
||||
- ACCEPT_EULA=Y
|
||||
volumes:
|
||||
- ${DATA_SAVE_PATH}/mssql:/var/opt/mssql
|
||||
ports:
|
||||
- "${MSSQL_PORT}:1433"
|
||||
networks:
|
||||
- backend
|
||||
|
||||
### MariaDB Container #######################################
|
||||
|
||||
mariadb:
|
||||
build: ./mariadb
|
||||
volumes:
|
||||
- mariadb:/var/lib/mysql
|
||||
ports:
|
||||
- "3306:3306"
|
||||
environment:
|
||||
MYSQL_DATABASE: homestead
|
||||
MYSQL_USER: homestead
|
||||
MYSQL_PASSWORD: secret
|
||||
MYSQL_ROOT_PASSWORD: root
|
||||
build: ./mariadb
|
||||
volumes:
|
||||
- ${DATA_SAVE_PATH}/mariadb:/var/lib/mysql
|
||||
- ${MARIADB_ENTRYPOINT_INITDB}:/docker-entrypoint-initdb.d
|
||||
ports:
|
||||
- "${MARIADB_PORT}:3306"
|
||||
environment:
|
||||
- MYSQL_DATABASE=${MARIADB_DATABASE}
|
||||
- MYSQL_USER=${MARIADB_USER}
|
||||
- MYSQL_PASSWORD=${MARIADB_PASSWORD}
|
||||
- MYSQL_ROOT_PASSWORD=${MARIADB_ROOT_PASSWORD}
|
||||
networks:
|
||||
- backend
|
||||
|
||||
### PostgreSQL Container ####################################
|
||||
|
||||
postgres:
|
||||
build: ./postgres
|
||||
volumes:
|
||||
- postgres:/var/lib/postgresql/data
|
||||
ports:
|
||||
- "5432:5432"
|
||||
environment:
|
||||
POSTGRES_DB: homestead
|
||||
POSTGRES_USER: homestead
|
||||
POSTGRES_PASSWORD: secret
|
||||
build: ./postgres
|
||||
volumes:
|
||||
- ${DATA_SAVE_PATH}/postgres:/var/lib/postgresql/data
|
||||
ports:
|
||||
- "${POSTGRES_PORT}:5432"
|
||||
environment:
|
||||
- POSTGRES_DB=${POSTGRES_DB}
|
||||
- POSTGRES_USER=${POSTGRES_USER}
|
||||
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
|
||||
networks:
|
||||
- backend
|
||||
|
||||
### PostgreSQL PostGis Container ############################
|
||||
|
||||
postgres-postgis:
|
||||
build: ./postgres-postgis
|
||||
volumes:
|
||||
- postgres:/var/lib/postgresql/data
|
||||
ports:
|
||||
- "5432:5432"
|
||||
environment:
|
||||
POSTGRES_DB: homestead
|
||||
POSTGRES_USER: homestead
|
||||
POSTGRES_PASSWORD: secret
|
||||
build: ./postgres-postgis
|
||||
volumes:
|
||||
- ${DATA_SAVE_PATH}/postgres:/var/lib/postgresql/data
|
||||
ports:
|
||||
- "${POSTGRES_PORT}:5432"
|
||||
environment:
|
||||
- POSTGRES_DB=${POSTGRES_DB}
|
||||
- POSTGRES_USER=${POSTGRES_USER}
|
||||
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
|
||||
networks:
|
||||
- backend
|
||||
|
||||
### Neo4j Container #########################################
|
||||
|
||||
neo4j:
|
||||
build: ./neo4j
|
||||
ports:
|
||||
- "7474:7474"
|
||||
- "1337:1337"
|
||||
environment:
|
||||
- NEO4J_AUTH=homestead:secret
|
||||
volumes:
|
||||
- neo4j:/var/lib/neo4j/data
|
||||
build: ./neo4j
|
||||
ports:
|
||||
- "7474:7474"
|
||||
- "1337:1337"
|
||||
environment:
|
||||
- NEO4J_AUTH=default:secret
|
||||
volumes:
|
||||
- ${DATA_SAVE_PATH}/neo4j:/var/lib/neo4j/data
|
||||
networks:
|
||||
- backend
|
||||
|
||||
### MongoDB Container #######################################
|
||||
|
||||
mongo:
|
||||
build: ./mongo
|
||||
ports:
|
||||
- "27017:27017"
|
||||
volumes:
|
||||
- mongo:/data/db
|
||||
build: ./mongo
|
||||
ports:
|
||||
- "${MONGODB_PORT}:27017"
|
||||
volumes:
|
||||
- ${DATA_SAVE_PATH}/mongo:/data/db
|
||||
networks:
|
||||
- backend
|
||||
|
||||
### RethinkDB Container #######################################
|
||||
|
||||
rethinkdb:
|
||||
build: ./rethinkdb
|
||||
ports:
|
||||
- "8090:8080"
|
||||
volumes:
|
||||
- rethinkdb:/data/rethinkdb_data
|
||||
build: ./rethinkdb
|
||||
ports:
|
||||
- "${RETHINKDB_PORT}:8080"
|
||||
volumes:
|
||||
- ${DATA_SAVE_PATH}/rethinkdb:/data/rethinkdb_data
|
||||
networks:
|
||||
- backend
|
||||
|
||||
### Redis Container #########################################
|
||||
|
||||
redis:
|
||||
build: ./redis
|
||||
volumes:
|
||||
- redis:/data
|
||||
ports:
|
||||
- "6379:6379"
|
||||
build: ./redis
|
||||
volumes:
|
||||
- ${DATA_SAVE_PATH}/redis:/data
|
||||
ports:
|
||||
- "${REDIS_PORT}:6379"
|
||||
networks:
|
||||
- backend
|
||||
|
||||
### Aerospike c Container ###################################
|
||||
|
||||
aerospike:
|
||||
build: ./aerospike
|
||||
volumes_from:
|
||||
- workspace
|
||||
volumes:
|
||||
- aerospike:/opt/aerospike/data
|
||||
ports:
|
||||
- "3000:3000"
|
||||
- "3001:3001"
|
||||
- "3002:3002"
|
||||
- "3003:3003"
|
||||
|
||||
build: ./aerospike
|
||||
volumes_from:
|
||||
- workspace
|
||||
volumes:
|
||||
- ${DATA_SAVE_PATH}/aerospike:/opt/aerospike/data
|
||||
ports:
|
||||
- "${AEROSPIKE_SERVICE_PORT}:3000"
|
||||
- "${AEROSPIKE_FABRIC_PORT}:3001"
|
||||
- "${AEROSPIKE_HEARTBEAT_PORT}:3002"
|
||||
- "${AEROSPIKE_INFO_PORT}:3003"
|
||||
networks:
|
||||
- backend
|
||||
|
||||
### Memcached Container #####################################
|
||||
|
||||
memcached:
|
||||
build: ./memcached
|
||||
volumes:
|
||||
- memcached:/var/lib/memcached
|
||||
ports:
|
||||
- "11211:11211"
|
||||
links:
|
||||
- php-fpm
|
||||
build: ./memcached
|
||||
volumes:
|
||||
- ${DATA_SAVE_PATH}/memcached:/var/lib/memcached
|
||||
ports:
|
||||
- "${MEMCACHED_HOST_PORT}:11211"
|
||||
depends_on:
|
||||
- php-fpm
|
||||
networks:
|
||||
- backend
|
||||
|
||||
### Beanstalkd Container ####################################
|
||||
|
||||
beanstalkd:
|
||||
build: ./beanstalkd
|
||||
ports:
|
||||
- "11300:11300"
|
||||
privileged: true
|
||||
links:
|
||||
- php-fpm
|
||||
build: ./beanstalkd
|
||||
ports:
|
||||
- "${BEANSTALKD_HOST_PORT}:11300"
|
||||
privileged: true
|
||||
depends_on:
|
||||
- php-fpm
|
||||
networks:
|
||||
- backend
|
||||
|
||||
### RabbitMQ Container ######################################
|
||||
|
||||
rabbitmq:
|
||||
build: ./rabbitmq
|
||||
ports:
|
||||
- "5672:5672"
|
||||
- "15671:15671"
|
||||
- "8080:15672"
|
||||
privileged: true
|
||||
environment:
|
||||
RABBITMQ_DEFAULT_USER: guest
|
||||
RABBITMQ_DEFAULT_PASS: guest
|
||||
links:
|
||||
- php-fpm
|
||||
build: ./rabbitmq
|
||||
ports:
|
||||
- "${RABBITMQ_NODE_HOST_PORT}:5672"
|
||||
- "${RABBITMQ_MANAGEMENT_HTTP_HOST_PORT}:15672"
|
||||
- "${RABBITMQ_MANAGEMENT_HTTPS_HOST_PORT}:15671"
|
||||
privileged: true
|
||||
environment:
|
||||
- RABBITMQ_DEFAULT_USER=${RABBITMQ_DEFAULT_USER}
|
||||
- RABBITMQ_DEFAULT_PASS=${RABBITMQ_DEFAULT_PASS}
|
||||
depends_on:
|
||||
- php-fpm
|
||||
networks:
|
||||
- backend
|
||||
|
||||
### Beanstalkd Console Container ############################
|
||||
|
||||
beanstalkd-console:
|
||||
build: ./beanstalkd-console
|
||||
ports:
|
||||
- "2080:2080"
|
||||
links:
|
||||
- beanstalkd
|
||||
build: ./beanstalkd-console
|
||||
ports:
|
||||
- "2080:2080"
|
||||
depends_on:
|
||||
- beanstalkd
|
||||
networks:
|
||||
- backend
|
||||
|
||||
### Caddy Server Container ##################################
|
||||
|
||||
caddy:
|
||||
build: ./caddy
|
||||
ports:
|
||||
- "80:80"
|
||||
- "443:443"
|
||||
- "2015:2015"
|
||||
volumes_from:
|
||||
- applications
|
||||
volumes:
|
||||
- ./caddy/Caddyfile:/etc/Caddyfile
|
||||
- ./logs/caddy:/var/log/caddy
|
||||
- caddy:/root/.caddy
|
||||
links:
|
||||
- php-fpm
|
||||
build: ./caddy
|
||||
volumes_from:
|
||||
- applications
|
||||
volumes:
|
||||
- ${CADDY_CUSTOM_CADDYFILE}:/etc/Caddyfile
|
||||
- ${CADDY_HOST_LOG_PATH}:/var/log/caddy
|
||||
- ${DATA_SAVE_PATH}:/root/.caddy
|
||||
ports:
|
||||
- "${CADDY_HOST_HTTP_PORT}:80"
|
||||
- "${CADDY_HOST_HTTPS_PORT}:443"
|
||||
depends_on:
|
||||
- php-fpm
|
||||
networks:
|
||||
- frontend
|
||||
- backend
|
||||
|
||||
### phpMyAdmin Container ####################################
|
||||
|
||||
phpmyadmin:
|
||||
build: ./phpmyadmin
|
||||
environment:
|
||||
PMA_ARBITRARY: 1
|
||||
MYSQL_USER: homestead
|
||||
MYSQL_PASSWORD: secret
|
||||
MYSQL_ROOT_PASSWORD: root
|
||||
ports:
|
||||
- "8080:80"
|
||||
links:
|
||||
# for mysql container
|
||||
- "mysql:db"
|
||||
# for mariadb container
|
||||
# - "mariadb:db"
|
||||
build: ./phpmyadmin
|
||||
environment:
|
||||
- PMA_ARBITRARY=1
|
||||
- MYSQL_USER=${PMA_USER}
|
||||
- MYSQL_PASSWORD=${PMA_PASSWORD}
|
||||
- MYSQL_ROOT_PASSWORD=${PMA_ROOT_PASSWORD}
|
||||
ports:
|
||||
- "${PMA_PORT}:80"
|
||||
depends_on:
|
||||
- "${PMA_DB_ENGINE}"
|
||||
networks:
|
||||
- frontend
|
||||
- backend
|
||||
|
||||
### Adminer Container ####################################
|
||||
|
||||
adminer:
|
||||
build:
|
||||
context: ./adminer
|
||||
args:
|
||||
- INSTALL_MSSQL=${ADM_INSTALL_MSSQL}
|
||||
ports:
|
||||
- "${ADM_PORT}:8080"
|
||||
depends_on:
|
||||
- php-fpm
|
||||
networks:
|
||||
- frontend
|
||||
- backend
|
||||
|
||||
### pgAdmin Container #######################################
|
||||
|
||||
pgadmin:
|
||||
build: ./pgadmin
|
||||
ports:
|
||||
- "5050:5050"
|
||||
links:
|
||||
- postgres
|
||||
build: ./pgadmin
|
||||
ports:
|
||||
- "5050:5050"
|
||||
volumes:
|
||||
- ${DATA_SAVE_PATH}/pgadmin-backup:/var/lib/pgadmin4/data/storage/pgadmin4
|
||||
depends_on:
|
||||
- postgres
|
||||
networks:
|
||||
- frontend
|
||||
- backend
|
||||
|
||||
|
||||
### ElasticSearch Container #################################
|
||||
|
||||
elasticsearch:
|
||||
build: ./elasticsearch
|
||||
volumes:
|
||||
- elasticsearch-data:/usr/share/elasticsearch/data
|
||||
- elasticsearch-plugins:/usr/share/elasticsearch/data
|
||||
ports:
|
||||
- "9200:9200"
|
||||
- "9300:9300"
|
||||
links:
|
||||
- php-fpm
|
||||
build: ./elasticsearch
|
||||
volumes:
|
||||
- elasticsearch-data:/usr/share/elasticsearch/data
|
||||
- elasticsearch-plugins:/usr/share/elasticsearch/plugins
|
||||
environment:
|
||||
- cluster.name=laradock-cluster
|
||||
- bootstrap.memory_lock=true
|
||||
- "ES_JAVA_OPTS=-Xms256m -Xmx256m"
|
||||
ulimits:
|
||||
memlock:
|
||||
soft: -1
|
||||
hard: -1
|
||||
mem_limit: 512m
|
||||
ports:
|
||||
- "${ELASTICSEARCH_HOST_HTTP_PORT}:9200"
|
||||
- "${ELASTICSEARCH_HOST_TRANSPORT_PORT}:9300"
|
||||
depends_on:
|
||||
- php-fpm
|
||||
networks:
|
||||
- frontend
|
||||
- backend
|
||||
|
||||
### Selenium Container #########################################
|
||||
|
||||
### Kibana Container #######################################
|
||||
|
||||
kibana:
|
||||
build: ./kibana
|
||||
ports:
|
||||
- "${KIBANA_HTTP_PORT}:5601"
|
||||
depends_on:
|
||||
- elasticsearch
|
||||
networks:
|
||||
- frontend
|
||||
- backend
|
||||
|
||||
### Certbot Container ##################################
|
||||
|
||||
certbot:
|
||||
build:
|
||||
context: ./certbot
|
||||
volumes:
|
||||
- ./data/certbot/certs/:/var/certs
|
||||
- ./certbot/letsencrypt/:/var/www/letsencrypt
|
||||
environment:
|
||||
- CN="fake.domain.com"
|
||||
- EMAIL="fake.email@gmail.com"
|
||||
networks:
|
||||
- frontend
|
||||
|
||||
### Mailhog Container #########################################
|
||||
|
||||
mailhog:
|
||||
build: ./mailhog
|
||||
ports:
|
||||
- "1025:1025"
|
||||
- "8025:8025"
|
||||
networks:
|
||||
- frontend
|
||||
- backend
|
||||
|
||||
### Selenium Container ########################################
|
||||
|
||||
selenium:
|
||||
build: ./selenium
|
||||
ports:
|
||||
- "4444:4444"
|
||||
volumes:
|
||||
# see https://github.com/SeleniumHQ/docker-selenium#running-the-images
|
||||
- /dev/shm:/dev/shm
|
||||
build: ./selenium
|
||||
ports:
|
||||
- "${SELENIUM_PORT}:4444"
|
||||
volumes:
|
||||
- /dev/shm:/dev/shm
|
||||
networks:
|
||||
- frontend
|
||||
|
||||
### Volumes Setup ###########################################
|
||||
### Varnish Proxy 1 ##########################################
|
||||
|
||||
proxy:
|
||||
build: ./varnish
|
||||
expose:
|
||||
- ${VARNISH_PORT}
|
||||
environment:
|
||||
- VARNISH_CONFIG=${VARNISH_CONFIG}
|
||||
- CACHE_SIZE=${VARNISH_PROXY1_CACHE_SIZE}
|
||||
- VARNISHD_PARAMS=${VARNISHD_PARAMS}
|
||||
- VARNISH_PORT=${VARNISH_PORT}
|
||||
- BACKEND_HOST=${VARNISH_PROXY1_BACKEND_HOST}
|
||||
- BACKEND_PORT=${VARNISH_BACKEND_PORT}
|
||||
- VARNISH_SERVER=${VARNISH_PROXY1_SERVER}
|
||||
links:
|
||||
- workspace
|
||||
networks:
|
||||
- frontend
|
||||
|
||||
### Varnish Proxy 2 ##########################################
|
||||
|
||||
proxy2:
|
||||
build: ./varnish
|
||||
expose:
|
||||
- ${VARNISH_PORT}
|
||||
environment:
|
||||
- VARNISH_CONFIG=${VARNISH_CONFIG}
|
||||
- CACHE_SIZE=${VARNISH_PROXY2_CACHE_SIZE}
|
||||
- VARNISHD_PARAMS=${VARNISHD_PARAMS}
|
||||
- VARNISH_PORT=${VARNISH_PORT}
|
||||
- BACKEND_HOST=${VARNISH_PROXY2_BACKEND_HOST}
|
||||
- BACKEND_PORT=${VARNISH_BACKEND_PORT}
|
||||
- VARNISH_SERVER=${VARNISH_PROXY2_SERVER}
|
||||
links:
|
||||
- workspace
|
||||
networks:
|
||||
- frontend
|
||||
|
||||
### Balancer Haproxy ##########################################
|
||||
|
||||
balancer:
|
||||
build: ./haproxy
|
||||
ports:
|
||||
- "${HAPROXY_HOST_HTTP_PORT}:8085"
|
||||
volumes:
|
||||
- /var/run/docker.sock:/var/run/docker.sock
|
||||
links:
|
||||
- proxy
|
||||
- proxy2
|
||||
|
||||
### Jenkins ###################################################
|
||||
|
||||
jenkins:
|
||||
build: ./jenkins
|
||||
environment:
|
||||
JAVA_OPTS: "-Djava.awt.headless=true"
|
||||
ports:
|
||||
- "${JENKINS_HOST_SLAVE_AGENT_PORT}:50000"
|
||||
- "${JENKINS_HOST_HTTP_PORT}:8080"
|
||||
privileged: true
|
||||
volumes:
|
||||
- ${JENKINS_HOME}:/var/jenkins_home
|
||||
- /var/run/docker.sock:/var/run/docker.sock
|
||||
networks:
|
||||
- frontend
|
||||
- backend
|
||||
|
||||
### Laravel Echo Server #######################################
|
||||
laravel-echo-server:
|
||||
build:
|
||||
context: ./laravel-echo-server
|
||||
volumes:
|
||||
- ./laravel-echo-server/laravel-echo-server.json:/app/laravel-echo-server.json:ro
|
||||
ports:
|
||||
- "${LARAVEL_ECHO_SERVER_PORT}:6001"
|
||||
links:
|
||||
- redis
|
||||
networks:
|
||||
- frontend
|
||||
- backend
|
||||
|
||||
### AWS EB-CLI ####
|
||||
aws:
|
||||
build:
|
||||
context: ./aws
|
||||
volumes_from:
|
||||
- applications
|
||||
depends_on:
|
||||
- workspace
|
||||
tty: true
|
||||
|
||||
### Networks Setup ############################################
|
||||
|
||||
networks:
|
||||
frontend:
|
||||
driver: "bridge"
|
||||
backend:
|
||||
driver: "bridge"
|
||||
|
||||
### Volumes Setup #############################################
|
||||
|
||||
volumes:
|
||||
mysql:
|
||||
driver: "local"
|
||||
postgres:
|
||||
driver: "local"
|
||||
memcached:
|
||||
driver: "local"
|
||||
redis:
|
||||
driver: "local"
|
||||
neo4j:
|
||||
driver: "local"
|
||||
mariadb:
|
||||
driver: "local"
|
||||
mongo:
|
||||
driver: "local"
|
||||
minio:
|
||||
driver: "local"
|
||||
rethinkdb:
|
||||
driver: "local"
|
||||
phpmyadmin:
|
||||
driver: "local"
|
||||
aerospike:
|
||||
driver: "local"
|
||||
caddy:
|
||||
driver: "local"
|
||||
elasticsearch-data:
|
||||
driver: "local"
|
||||
elasticsearch-plugins:
|
||||
driver: "local"
|
||||
sessions: ## nothing is connected to this (- ./data/sessions:/sessions)
|
||||
driver: "local"
|
||||
mysql:
|
||||
driver: "local"
|
||||
percona:
|
||||
driver: "local"
|
||||
mssql:
|
||||
driver: "local"
|
||||
postgres:
|
||||
driver: "local"
|
||||
memcached:
|
||||
driver: "local"
|
||||
redis:
|
||||
driver: "local"
|
||||
neo4j:
|
||||
driver: "local"
|
||||
mariadb:
|
||||
driver: "local"
|
||||
mongo:
|
||||
driver: "local"
|
||||
minio:
|
||||
driver: "local"
|
||||
rethinkdb:
|
||||
driver: "local"
|
||||
phpmyadmin:
|
||||
driver: "local"
|
||||
adminer:
|
||||
driver: "local"
|
||||
aerospike:
|
||||
driver: "local"
|
||||
caddy:
|
||||
driver: "local"
|
||||
elasticsearch-data:
|
||||
driver: "local"
|
||||
elasticsearch-plugins:
|
||||
driver: "local"
|
||||
|
13
docker-sync.yml
Normal file
@ -0,0 +1,13 @@
|
||||
version: "2"
|
||||
|
||||
options:
|
||||
verbose: true
|
||||
syncs:
|
||||
applications-docker-sync: # name of the intermediary sync volume
|
||||
compose-dev-file-path: 'docker-compose.sync.yml' # docker-compose override file
|
||||
|
||||
src: '${APPLICATION}' # host source directory
|
||||
sync_userid: 1000 # giving permissions to www-data user (as defined in nginx and php-fpm Dockerfiles)
|
||||
sync_strategy: '${DOCKER_SYNC_STRATEGY}' # for osx use 'native_osx', for windows use 'unison'
|
||||
|
||||
sync_excludes: ['laradock', 'ignored_folder_example'] # ignored directories
|