Compare commits

...

153 Commits

Author SHA1 Message Date
d340b6e60f Merge pull request #1140 from deleugpn/patch-1
Make it easier to solve nginx build stuck
2017-09-19 01:39:15 +03:00
e7357eab83 Merge pull request #1142 from roelal/apache_socket_timeout
add APACHE_PHP_UPSTREAM_TIMEOUT
2017-09-19 01:38:28 +03:00
110aa91c59 add APACHE_PHP_UPSTREAM_TIMEOUT 2017-09-18 15:24:48 +02:00
e5aef41dd2 Make it easier to solve nginx build stuck 2017-09-18 13:07:30 +02:00
ae048e6c66 Merge pull request #1137 from JoelRSimpson/patch-1
Update docker-compose.yml
2017-09-15 22:08:55 +03:00
a5f3a92eb4 Update docker-compose.yml
It looks like the 
     219: user: "1000:50" 
statement was added a while back to fix a file permissions issue, but on a completely fresh up it keeps mysql from starting, generating the following.  Removing the line allowed everything to work properly.:

mysql_1                | Initializing database
mysql_1                | mysqld: Can't create/write to file '/var/lib/mysql/is_writable' (Errcode: 13 - Permission denied)
mysql_1                | 2017-09-14T23:55:30.989254Z 0 [Note] Basedir set to /usr/
mysql_1                | 2017-09-14T23:55:30.989559Z 0 [Warning] The syntax '--symbolic-links/-s' is deprecated and will be removed in a future release
mysql_1                | 2017-09-14T23:55:30.989602Z 0 [Warning] 'NO_ZERO_DATE', 'NO_ZERO_IN_DATE' and 'ERROR_FOR_DIVISION_BY_ZERO' sql modes should be used with strict mode. They will be merged with strict mode in a future release.
mysql_1                | 2017-09-14T23:55:30.990877Z 0 [ERROR] --initialize specified but the data directory exists and is not writable. Aborting.
mysql_1                | 2017-09-14T23:55:30.990886Z 0 [ERROR] Aborting
2017-09-14 17:17:34 -07:00
655b9a1526 Merge pull request #1128 from chkm8/aws-ebcli
Aws ebcli
2017-09-13 00:17:05 +03:00
7ac37ecd35 added aws docs 2017-09-12 04:30:53 +08:00
792789e479 added eb cli container 2017-09-12 04:13:44 +08:00
801ccd47d2 Merge pull request #1121 from freearhey/master
Added support of ImageMagick
2017-09-06 14:59:29 +03:00
5c5f94600a Rename laravel.pool.conf to xlaravel.pool.conf
Fix issue #1011
2017-09-06 00:22:18 +03:00
b2e372054f Fixed php-fpm build 2017-09-05 23:36:30 +03:00
0a23d53ee5 Move php-imagick to php-fpm and enable it 2017-09-05 21:47:47 +03:00
f6552aca97 Added support of ImageMagick to php-fpm 2017-09-05 21:09:34 +03:00
e9806d9bca Merge pull request #1120 from WanchiaTsai/add-env-path-for-node
add ENV PATH, fix the problem of docker-compose exec workspace npm(or…
2017-09-05 16:30:44 +03:00
e56801846b add ENV PATH, fix the problem of docker-compose exec workspace npm(or other node-related script). 2017-09-05 11:06:53 +08:00
f9e6acd4e1 Fix syntax error 2017-09-05 03:15:24 +03:00
b61ff4f484 Added support of ImageMagick 2017-09-05 02:36:24 +03:00
8485add87a Merge pull request #1117 from masterjus/fix-php_redis-installation
Fix Php Redis extension installation
2017-09-04 22:40:21 +03:00
a36620c3bd Restart build 2017-09-04 12:05:34 +03:00
cddc934e1e Fix phpreddis installation for all versions of php 2017-09-04 11:33:14 +03:00
53b3ad0f7e Fix Php Redis extension installation 2017-08-31 19:29:19 +03:00
fdcf9117ac Merge pull request #1115 from joaorobertopb/patch-1
Changes to correct version of dockerfile
2017-08-30 01:07:37 +03:00
f800a3221a Changes to correct version of dockerfile
- Removes extra spaces
2017-08-29 12:54:01 -03:00
a1d3eeb7e6 Merge pull request #1107 from oaattia/master
Can't create/write to file '/var/lib/mysql/is_writable'
2017-08-23 21:14:29 +03:00
b2f7348552 Merge pull request #1101 from terryzwt/drpual-console
add drupal console to workspace
2017-08-23 21:14:13 +03:00
ebeddcba23 Merge pull request #1097 from macghriogair/master
[php-worker] dedicated dockerfile for php 7.0/7.1
2017-08-23 21:11:45 +03:00
dba37307b5 Merge pull request #1093 from zuohuadong/patch-7
fix to backup and fix max client
2017-08-23 21:11:02 +03:00
2af5b2ff49 fix mysql can't write to file 2017-08-22 12:12:56 +03:00
93d5b318fe add drupal console to workspace 2017-08-19 22:58:40 +08:00
9ce470e14e [php-worker] dedicated dockerfile for php 7.0/7.1
fixes #927: PHP-Worker container uses PHP-CLI 7.0.9 despite workspace using 7.1.4
2017-08-17 09:39:37 +02:00
38fb49bccc Merge pull request #1095 from exfriend/patch-2
Fix supervisord.conf file path
2017-08-17 04:37:18 +03:00
08896f9fb6 Fix supervisord.conf file path
otherwise image ignores the supplied supervisord.conf
2017-08-16 00:33:51 +03:00
dcab211b07 Merge pull request #1094 from zuohuadong/patch-8
add pgadmin backup volumes
2017-08-14 23:53:31 +03:00
76001daf71 add pgadmin backup volumes
you can use backup files  in ${DATA_SAVE_PATH}/pgadmin-backup
2017-08-14 10:09:17 +08:00
30b626d43e fix to backup and fix max client
in  this version, you can backup postgresql
2017-08-14 10:04:11 +08:00
586a225c11 Merge pull request #1089 from ELD/add-dusk-support-and-docs
add docs on running Laravel Dusk tests
2017-08-11 10:26:31 +03:00
c099a51d52 add docs on running Laravel Dusk tests 2017-08-10 21:08:09 -06:00
245ddf3441 update documentation link in the readme 2017-08-09 16:18:29 +03:00
0192346cf2 Merge pull request #1082 from arywidiantara/master
[UPDATE] change config redis from docker compose to env
2017-08-09 11:28:06 +03:00
e4f4de47e7 [UPDATE] change config redis from docker compose to env 2017-08-09 10:17:53 +07:00
69ccd74d2e Update Improve MAC speed docs 2017-08-08 15:01:41 +03:00
a3c66fdecf Merge pull request #1080 from zuohuadong/patch-6
use openssh-client not  openssh*
2017-08-08 09:03:55 +03:00
9b8eee6a98 Merge pull request #1079 from zuohuadong/patch-5
add demo and  use  caddy example for laravel
2017-08-08 09:03:18 +03:00
668acd66c1 use openssh-client not openssh*
https://hub.docker.com/r/abiosoft/caddy/~/dockerfile/
2017-08-08 11:36:16 +08:00
b25215684b add demo and use caddy example for laravel
https://github.com/caddyserver/examples/blob/master/laravel/Caddyfile
2017-08-08 11:33:42 +08:00
8e84fbbec2 add missing symfony and python to workspace and remove useless alias 2017-08-07 12:36:02 +03:00
1e650d8643 Merge branch 'master' of https://github.com/laradock/laradock into dev
* 'master' of https://github.com/laradock/laradock:
  update Install Symfony steps in the docs
  Update docker-compose.yml
  Update env-example
  Update Dockerfile-70
  fix rm error
2017-08-07 12:06:51 +03:00
4977b0f92f fix alias for phpunit to load from current directory 2017-08-07 12:06:11 +03:00
2082659fb1 update Install Symfony steps in the docs 2017-08-07 05:57:45 +03:00
1fe2df73e4 Merge pull request #1077 from hounded/master
Missing symfony variables in env-example and workspace. Added python as an option to workspace
2017-08-07 05:51:58 +03:00
05c7f9186a Update docker-compose.yml
Added missing symfony and python options to workspace
2017-08-07 08:47:53 +12:00
3801973b15 Update env-example
Added missing symfony install variable and added new python install variable
2017-08-07 08:45:25 +12:00
6d89424e91 Update Dockerfile-70
Add python option to workspace
2017-08-07 08:42:55 +12:00
b1c1e6e187 Merge pull request #1075 from bestlong/fix-php-worker-rm-error
fix php-worker build error
2017-08-04 15:45:48 +08:00
972bdd90a3 fix rm error
ERROR INFO:

Step 4/5 : RUN rm -r /var/lib/apt/lists/*
 ---> Running in 4a3aa49e0e6e
rm: can't remove '/var/lib/apt/lists/*': No such file or directory
ERROR: Service 'php-worker' failed to build: The command '/bin/sh -c rm -r /var/lib/apt/lists/*' returned a non-zero code: 1
2017-08-04 15:11:10 +08:00
2af40b0ba1 fix #970. remove the required public directory in the /var/www 2017-08-04 00:51:20 +03:00
5c0b8316b1 make the PHP_UPSTREAM config for NGINX and Apache identical 2017-08-04 00:50:20 +03:00
004e4354aa add more aliases and functions for better development in the workspace 2017-08-03 08:06:48 +03:00
d99cf73bf0 edit alias, use the phpunit of the project 2017-08-03 07:31:41 +03:00
a365425c73 Merge branch 'master' of github.com:laradock/laradock
* 'master' of github.com:laradock/laradock:
  format the readme.md file
  fix travis ci hugo job get "cannot create directory" error.
  fixed #1068
  update some `guide` format in the documentation
2017-08-01 22:12:59 +03:00
c836500488 add symfony, laravel and app nginx sites sampels 2017-08-01 22:12:43 +03:00
318ca3f81c format the readme.md file 2017-07-29 10:03:50 +03:00
82219ededb Merge pull request #1072 from bestlong/fix-travis-ci-hugo-job-failed
fix travis ci hugo job get "cannot create directory" error.
2017-07-28 00:23:18 +08:00
d6ff224b0d fix travis ci hugo job get "cannot create directory" error. 2017-07-27 23:45:18 +08:00
b1144bba7e Merge pull request #1069 from terryzwt/master
fixed #1068 drush need mysql-client installed
2017-07-26 20:08:03 +03:00
a590ed78ce fixed #1068 2017-07-26 13:15:12 +08:00
f852789720 update some guide format in the documentation 2017-07-26 03:27:24 +03:00
d32cfb31b1 update ISSUE_TEMPLATE.md context 2017-07-26 02:42:24 +03:00
e671f4c929 Update PULL_REQUEST_TEMPLATE.md context 2017-07-26 02:40:26 +03:00
aef2769e60 Merge branch 'hackel-change-mysql-version'
* hackel-change-mysql-version:
  Add documentation on the MYSQL_VERSION variable.
  Allow specifying the version of MySQL to install in .env file.
2017-07-25 23:33:58 +03:00
63816ab7d6 Merge branch 'change-mysql-version' of https://github.com/hackel/laradock into hackel-change-mysql-version
* 'change-mysql-version' of https://github.com/hackel/laradock:
  Add documentation on the MYSQL_VERSION variable.
  Allow specifying the version of MySQL to install in .env file.
2017-07-25 23:30:46 +03:00
e7a16bb98e Merge pull request #1063 from St4inl3ss/remote_debug_documentation_phpStorm_linux
Xdebug configuration for Linux on PhpStorm
2017-07-21 10:58:44 +03:00
e496a82150 Xdebug configuration for Linux on PhpStorm
Added images and explanations for setting up remote debugging for PhpStorm on Linux

Also modified slightly Install Xdebug section to keep reading consistent
2017-07-20 10:52:13 -04:00
f258b38a18 Merge pull request #1058 from arianacosta/integrating_docker_sync
Integrating docker sync
2017-07-16 22:26:08 +03:00
a80fb99d21 added support for docker-sync and added sync.sh script to simplify the use of docker-sync with laradock 2017-07-16 10:09:46 -04:00
6b0ee10988 added docker sync documentation 2017-07-16 10:06:12 -04:00
1e2d368e43 improved docs 2017-07-15 19:28:02 -04:00
829a5b5acf cleaning up 2017-07-15 18:53:01 -04:00
112e31a933 polishing last details 2017-07-15 18:47:02 -04:00
8af22b5b37 finalizing changes 2017-07-15 18:32:05 -04:00
7029118f05 sdfasdf 2017-07-15 17:16:30 -04:00
a1f8ef9614 adding default services 2017-07-15 17:15:07 -04:00
97d198e967 sync functions only 2017-07-15 16:58:17 -04:00
722e73a3e6 kept only sync specific functions 2017-07-15 16:58:07 -04:00
1d2f385586 adding options 2017-07-15 16:36:25 -04:00
7b180524e3 adding base functions 2017-07-15 16:24:59 -04:00
a670dd91cd adding base functions 2017-07-15 16:24:49 -04:00
a0f1d39ce4 added bash option 2017-07-15 16:03:33 -04:00
6bed8d14f1 improved messages 2017-07-15 15:46:00 -04:00
e26ff8bb1e improving comments 2017-07-15 14:46:00 -04:00
7fdda613a5 improving messages 2017-07-15 14:43:22 -04:00
b7d3691c8d resetting last change 2017-07-15 14:41:35 -04:00
b0a6f2d689 stopping if errors happen 2017-07-15 14:39:49 -04:00
8e20ec7617 improved colors 2017-07-15 14:36:15 -04:00
a38cecef92 improving colors 2017-07-15 14:24:01 -04:00
3bf572b7a4 added colors 2017-07-15 13:52:23 -04:00
2acc9f5d6f cleaning up files 2017-07-15 12:36:02 -04:00
abae2dc09e updated command 2017-07-15 12:00:44 -04:00
407fb7a395 updaeted commmand 2017-07-15 12:00:35 -04:00
0c1b6ba9bf improving script 2017-07-15 11:13:50 -04:00
855e2a47b5 passing only the second argument and onward 2017-07-15 11:08:01 -04:00
988bbf7bde putting up arg 2017-07-15 11:05:16 -04:00
ef7f251654 fixed command 2017-07-15 11:04:45 -04:00
3d29c62bfb adding more commands 2017-07-15 11:01:52 -04:00
3e5d1d919a running in daemon mode 2017-07-15 09:56:03 -04:00
a38794ebcc passing parameters 2017-07-15 09:53:56 -04:00
56ca814ebb comparing bash strings correctly 2017-07-15 09:46:52 -04:00
c17abbea6e stopping docker sync 2017-07-15 09:44:09 -04:00
0d5080d6bb fixed typo 2017-07-15 09:41:57 -04:00
e9a01c0174 modified bash script 2017-07-15 09:40:25 -04:00
5ea7b98db8 added bash script 2017-07-15 09:40:05 -04:00
5eae7f3006 organizing sync file 2017-07-15 09:23:32 -04:00
d83c9be2ea disabling unused services 2017-07-15 09:05:29 -04:00
9585a4a7ab changing compose file name for using docker sync stack 2017-07-15 08:28:15 -04:00
42fc8b7b57 separating syn compose file 2017-07-15 08:19:49 -04:00
0aa63c40f8 defining user id 1000 2017-07-15 07:09:58 -04:00
f59b9ebda6 removed user 2017-07-15 07:01:45 -04:00
b2c6e53bfa adding quotes to user 2017-07-15 06:48:23 -04:00
9970a00533 adding php-fpm user 2017-07-15 06:40:06 -04:00
3752f48249 displaying php errors 2017-07-14 19:27:16 -04:00
0baf791728 enabling sync 2017-07-14 19:17:50 -04:00
11687ffd36 disabling docker-sync 2017-07-14 19:14:51 -04:00
aa22f5d648 fixing applications sync volume name 2017-07-14 17:15:45 -04:00
00a38fe274 added docker-sync support 2017-07-14 17:03:01 -04:00
fe096ce282 move github repository files to the .github directory 2017-07-13 20:30:27 +03:00
b4ca9c5596 Create CONTRIBUTING.md 2017-07-13 04:15:09 +03:00
d85b76f0d1 Merge pull request #1057 from laradock/add-code-of-conduct-1
Create CODE_OF_CONDUCT.md
2017-07-13 04:09:20 +03:00
f2a9712041 Create CODE_OF_CONDUCT.md 2017-07-13 04:08:59 +03:00
09bf0566af Adding Vince Chu to the team
Welcome @vwchu :)
2017-07-12 18:32:22 +03:00
b8c5163c03 Merge pull request #1052 from ojhaujjwal/image-optimizers
image optimizer tools
2017-07-12 15:54:01 +03:00
9dda2f6b9f image optimizers libraries 2017-07-10 18:49:39 +05:45
ca5a1ee674 Merge pull request #1043 from vwchu/feat-entrypoint-initdb
Parameterize docker-entrypoint-initdb.d for MySQL + MariaDB + Percona
2017-07-08 12:10:37 +03:00
0e93477db0 Merge pull request #1051 from ojhaujjwal/patch-1
fix php7.1-xdebug because of missing new line
2017-07-08 12:10:18 +03:00
7765df1076 fix php7.1-xdebug because of missing new line 2017-07-08 10:00:52 +05:45
fe38f0c2ff Add documentation on the MYSQL_VERSION variable. 2017-07-07 17:02:05 -05:00
7ec8b8846e Allow specifying the version of MySQL to install in .env file. 2017-07-07 16:43:06 -05:00
422d6d8dd0 Merge pull request #1049 from igittGit/patch-2
Update Dockerfile-71
2017-07-07 14:33:29 +03:00
d021777b06 Merge pull request #1044 from vwchu/fix-1041
fix #1041
2017-07-07 14:33:03 +03:00
f2f665dc08 Update Dockerfile-71
php7.1-xdebug instead of php-xdebug instead.
apt-get update needed therefore
2017-07-07 13:21:14 +02:00
02e2454c79 add docker-entrypoint-initdb.d variables for MySQL + MariaDB + Percona 2017-07-06 00:39:16 -04:00
9d2be424de fix #1041
Possible fix described on: https://bugs.mysql.com/bug.php?id=85946

```
[mysqld]
character-set-server=utf8
```
2017-07-06 00:31:42 -04:00
bf60f7520b Merge pull request #1038 from vwchu/master
add APACHE_SITES_PATH variable
2017-07-04 07:25:40 +03:00
916e9f38f3 Merge pull request #1022 from ItaloBC/patch-3
ElasticSearch instance fails at loading (missing parameters)
2017-07-04 07:25:20 +03:00
ebc24ced66 Merge pull request #1000 from zuohuadong/patch-4
Fix pgadmin can't boot
2017-07-04 07:23:08 +03:00
3e59a2a813 add creating multiple databases to the docs 2017-07-04 06:01:18 +03:00
50834268a7 upgrade mysql base image to 8.0 2017-07-04 06:00:45 +03:00
007017a2a7 fix mysql error no access 2017-07-04 06:00:31 +03:00
094aa9beb1 Merge pull request #1040 from sakanaproductions/fix-1017
fixed issue #1017, added ENV variables back to Dockerfile and added …
2017-07-04 00:36:06 +03:00
19f9b25a46 fixed issue #1017, added ENV variables back to Dockerfile and added startup file back 2017-06-30 17:48:24 -07:00
bc1c957f47 add APACHE_SITES_PATH variable 2017-06-30 06:22:55 -04:00
bbbd247653 ElasticSearch instance fails at loading (wrong)
ElasticSearch (ES from now onwards) will fail to initialize since the parameters for its environment are not correct or absent. These are:

* `cluster.name`: Name of the cluster itself
* `bootstrap.memory_lock`: Needed for ES to [lock the JVM into swap instead of memory](https://www.elastic.co/guide/en/elasticsearch/reference/master/_memory_lock_check.html).
* `"ES_JAVA_OPTS=-Xms256m -Xmx256m"`: [Initial and maximum HEAP size for JVM](https://www.elastic.co/guide/en/elasticsearch/reference/current/_heap_size_check.html). Since it's locked to disk, should be the same. Half the defaults (512m) for development.
* `ulimits: memlock: soft (-1), hard (-1)`: [ES needs to have unlimited access to memory](https://www.elastic.co/guide/en/elasticsearch/reference/current/max-size-virtual-memory-check.html), otherwise it will feel sluggish.  
* `mem_limit: 512m`: Hard limit the memory available for the container.

This can, and should, be changed using `.env` file variables, but it seems that this should suffice for basic ES development.
2017-06-14 14:19:47 -04:00
cbfd160cbf Fix 2017-06-06 18:11:31 +08:00
43 changed files with 1255 additions and 220 deletions

46
.github/CODE_OF_CONDUCT.md vendored Normal file
View 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
View File

@ -0,0 +1,3 @@
### First off, thanks for taking the time to contribute!
For the contribution guide [click here](http://laradock.io/contributing/).

View File

@ -5,22 +5,19 @@
- System info disto/version: - System info disto/version:
### Issue: ### Issue:
##### What seems to be going wrong? <!--- What seems to be wrong? -->
_____ _____
### Expected behavior: ### Expected behavior:
##### What should be happening instead? <!--- What should happen instead? -->
_____ _____
### Reproduce: ### Reproduce:
##### How might we be able to reproduce the error? <!--- How can we reproduce the error? -->
_____ _____
### Relevant Code: ### Relevant Code:
``` ```
// place code here // place a code sample here
``` ```

View File

@ -1,7 +1,7 @@
### Thank you for contributing to Laradock. <!--- Thank you for contributing to Laradock -->
##### Make sure you completed the basic 3 steps below: ##### I completed the 3 steps below:
- [] I've read the simple [Contribution Guide](http://laradock.io/contributing). - [] 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'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 :) - [] I enjoyed my time contributing and making developer's life easier :)

49
.github/README.md vendored Normal file
View 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
View File

@ -2,4 +2,5 @@
/logs /logs
/data /data
.env .env
/.project /.project
.docker-sync

View File

@ -5,6 +5,8 @@ weight: 3
--- ---
<a name="List-current-running-Containers"></a> <a name="List-current-running-Containers"></a>
## List current running Containers ## List current running Containers
```bash ```bash
@ -153,28 +155,8 @@ You might use the `--no-cache` option if you want full rebuilding (`docker-compo
<br>
<a name="Docker-Sync"></a>
## Docker-Sync
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.
The problem originates in bind-mount performance on MacOS. Docker for Mac uses osxfs by default. This is not without reason, it has [a lot of advantages](https://docs.docker.com/docker-for-mac/osxfs/).
Solutions to resolve this issue are easily installed however, we're hoping it'll be fixed by Docker themselves over time. They are currently [adding "cached and delegated" options](https://github.com/docker/for-mac/issues/77#issuecomment-283996750), which is partly available for Docker Edge.
Options are [to switch over to NFS](https://github.com/IFSight/d4m-nfs) which is the simplest. The fastest option is [Docker-Sync "native"](https://github.com/EugenMayer/docker-sync) which is still quite easy to install.
Clone [this repo](https://github.com/EugenMayer/docker-sync-boilerplate) to your machine, copy `default/docker-sync.yml` to your Laradock directory and run `docker-sync-stack start`. Be sure to use `docker-sync-stack clean` to stop and `docker-compose build` to rebuild. More information can be found [in the Docker-sync docs](https://github.com/EugenMayer/docker-sync).
<br> <br>
<a name="Add-Docker-Images"></a> <a name="Add-Docker-Images"></a>
## Add more Software (Docker Images) ## Add more Software (Docker Images)
To add an image (software), just edit the `docker-compose.yml` and add your container details, to do so you need to be familiar with the [docker compose file syntax](https://docs.docker.com/compose/compose-file/). To add an image (software), just edit the `docker-compose.yml` and add your container details, to do so you need to be familiar with the [docker compose file syntax](https://docs.docker.com/compose/compose-file/).
@ -192,14 +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: However to view the logs of all the other containers (MySQL, PHP-FPM,...) you can run this:
```bash ```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/) More [options](https://docs.docker.com/compose/reference/logs/)
```bash
docker logs -f {container-name}
```
@ -247,7 +232,7 @@ By default **PHP-FPM 7.0** is running.
php-fpm: php-fpm:
build: build:
context: ./php-fpm context: ./php-fpm
dockerfile: Dockerfile-70 dockerfile: Dockerfile-56
... ...
``` ```
@ -330,9 +315,7 @@ It should be like this:
... ...
``` ```
2 - Re-build the containers `docker-compose build workspace php-fpm` 2 - Open `laradock/workspace/xdebug.ini` and `laradock/php-fpm/xdebug.ini` and enable at least the following configurations:
3 - Open `laradock/workspace/xdebug.ini` and/or `laradock/php-fpm/xdebug.ini` and enable at least the following configurations:
``` ```
xdebug.remote_autostart=1 xdebug.remote_autostart=1
@ -340,11 +323,25 @@ xdebug.remote_enable=1
xdebug.remote_connect_back=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).
![Debug Configuration](/images/photos/PHPStorm/linux/configuration/debugConfiguration.png "Debug 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.
![Server Configuration](/images/photos/PHPStorm/linux/configuration/serverConfiguration.png "Server Configuration").
- Start listening for debug connections, place a breakpoint and you are good to go !
<br> <br>
@ -734,7 +731,7 @@ docker-compose up -d mariadb phpmyadmin
1 - Run the Adminer Container (`adminer`) with the `docker-compose up` command. Example: 1 - Run the Adminer Container (`adminer`) with the `docker-compose up` command. Example:
```bash ```bash
docker-compose up -d adminer docker-compose up -d adminer
``` ```
2 - Open your browser and visit the localhost on port **8080**: `http://localhost:8080` 2 - Open your browser and visit the localhost on port **8080**: `http://localhost:8080`
@ -925,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> <br>
<a name="CodeIgniter"></a> <a name="CodeIgniter"></a>
@ -946,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`. 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> <br>
<a name="Misc"></a> <a name="Misc"></a>
@ -1023,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> <br>
<a name="MySQL-access-from-host"></a> <a name="MySQL-access-from-host"></a>
## MySQL access from host ## MySQL access from host
@ -1057,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> <br>
<a name="Change-MySQL-port"></a> <a name="Change-MySQL-port"></a>
@ -1377,7 +1436,11 @@ Moving from Docker Toolbox (VirtualBox) to Docker Native (for Mac/Windows). Requ
<a name="Speed-MacOS"></a> <a name="Speed-MacOS"></a>
## Improve speed on MacOS ## Improve speed on MacOS
Sharing code into Docker containers with osxfs have very poor performance compared to Linux. Likely there are some workarounds: 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.
So since sharing code into Docker containers with osxfs have very poor performance compared to Linux. Likely there are some workarounds:
### Workaround A: using dinghy ### Workaround A: using dinghy
@ -1397,9 +1460,99 @@ Quick Setup giude, (we recommend you check their docs)
<br>
<a name="Docker-Sync"></a>
### Workaround B: using d4m-nfs ### 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. [D4m-nfs](https://github.com/IFSight/d4m-nfs) automatically mount NFS volume instead of osxfs one.
1) Update the Docker [File Sharing] preferences: 1) Update the Docker [File Sharing] preferences:
@ -1439,17 +1592,10 @@ docker-compose up ...
### Other good workarounds:
- [docker-sync](https://github.com/EugenMayer/docker-sync)
- Add more here..
More details about this issue [here](https://github.com/docker/for-mac/issues/77).
@ -1534,3 +1680,7 @@ This error sometimes happens because your Laravel application isn't running on t
2. Change the `DB_HOST` variable on env with the IP that you received from previous step. 2. Change the `DB_HOST` variable on env with the IP that you received from previous step.
* Option B * 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 ngxinx 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.

View File

@ -112,9 +112,9 @@ Your folder structure should look like this:
2 - Go to `nginx/sites` and create config files to point to different project directory when visiting different domains. 2 - Go to `nginx/sites` and create config files to point to different project directory when visiting different domains.
Laradock by default includes `project-1.conf` and `project-2.conf` as working samples. Laradock by default includes `app.conf.example`, `laravel.conf.example` and `symfony.conf.example` as working samples.
3 - change the default names `project-n`: 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. 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.
@ -123,6 +123,7 @@ You can rename the config files, project folders and domains as you like, just m
``` ```
127.0.0.1 project-1.dev 127.0.0.1 project-1.dev
127.0.0.1 project-2.dev 127.0.0.1 project-2.dev
...
``` ```
> **Now jump to the [Usage](#Usage) section.** > **Now jump to the [Usage](#Usage) section.**

View File

@ -8,6 +8,7 @@ weight: 4
* [Production Setup on Digital Ocean](#Digital-Ocean) * [Production Setup on Digital Ocean](#Digital-Ocean)
* [PHPStorm XDebug Setup](#PHPStorm-Debugging) * [PHPStorm XDebug Setup](#PHPStorm-Debugging)
* [Running Laravel Dusk Test](#Laravel-Dusk)
@ -326,6 +327,7 @@ Set the following variables:
- `laradock/php-fpm/xdebug.ini` - `laradock/php-fpm/xdebug.ini`
Set the following variables: Set the following variables:
``` ```
xdebug.remote_autostart=1 xdebug.remote_autostart=1
xdebug.remote_enable=1 xdebug.remote_enable=1
@ -336,34 +338,39 @@ xdebug.cli_color=1
<a name="InstallCleanHouse"></a> <a name="InstallCleanHouse"></a>
### Need to clean house first? ### Need to clean house first?
Make sure you are starting with a clean state. For example, do you have other Laradock containers and images? 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. 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). - 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 {}` `docker ps -a | awk '{ print $1,$2 }' | grep laradock_ | awk '{print $1}' | xargs -I {} docker rm {}`
- Delete all images containing `laradock`. - Delete all images containing `laradock`.
`docker images | awk '{print $1,$2,$3}' | grep laradock_ | awk '{print $3}' | xargs -I {} docker rmi {}` `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:** 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: **Note:** Some may fail with:
`Error response from daemon: conflict: unable to delete 3f38eaed93df (cannot be forced) - image has dependent child images` `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. - 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 dclean() {
docker rmi $images processes=`docker ps -q -f status=exited`
fi 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: - 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* containers
# remove laravel_* images # remove laravel_* images
@ -406,14 +413,14 @@ laradock_php-fpm_1 php-fpm Up 9000/tcp
laradock_volumes_data_1 true Exit 0 laradock_volumes_data_1 true Exit 0
laradock_volumes_source_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 laradock_workspace_1 /sbin/my_init Up 0.0.0.0:2222->22/tcp
``` ```
<a name="enablePhpXdebug"></a> <a name="enablePhpXdebug"></a>
## Enable xDebug on php-fpm ## Enable xDebug on php-fpm
In a host terminal sitting in the laradock folder, run: `.php-fpm/xdebug status` In a host terminal sitting in the laradock folder, run: `.php-fpm/xdebug status`
You should see something like the following: You should see something like the following:
``` ```
xDebug status xDebug status
laradock_php-fpm_1 laradock_php-fpm_1
@ -422,6 +429,7 @@ Copyright (c) 1997-2016 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies Zend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies
with Xdebug v2.4.1, Copyright (c) 2002-2016, by Derick Rethans with Xdebug v2.4.1, Copyright (c) 2002-2016, by Derick Rethans
``` ```
Other commands include `.php-fpm/xdebug start | stop`. 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 If you have enabled `xdebug=true` in `docker-compose.yml/php-fpm`, `xdebug` will already be running when
@ -430,6 +438,7 @@ If you have enabled `xdebug=true` in `docker-compose.yml/php-fpm`, `xdebug` will
<a name="InstallPHPStormConfigs"></a> <a name="InstallPHPStormConfigs"></a>
## PHPStorm Settings ## PHPStorm Settings
- Here are some settings that are known to work: - Here are some settings that are known to work:
- `Settings/BuildDeploymentConnection` - `Settings/BuildDeploymentConnection`
- ![Settings/BuildDeploymentConnection](/images/photos/PHPStorm/Settings/BuildDeploymentConnection.png) - ![Settings/BuildDeploymentConnection](/images/photos/PHPStorm/Settings/BuildDeploymentConnection.png)
@ -547,4 +556,149 @@ Assuming that you are in laradock folder, type:
- ![ConnectionSSHAuth](/images/photos/KiTTY/ConnectionSSHAuth.png) - ![ConnectionSSHAuth](/images/photos/KiTTY/ConnectionSSHAuth.png)
- ![TerminalShell](/images/photos/KiTTY/TerminalShell.png) - ![TerminalShell](/images/photos/KiTTY/TerminalShell.png)
<br>
<br>
<br>
<br>
<br>
<a name="Laravel-Dusk"></a>
# Running Laravel Dusk Tests
- [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/)

Binary file not shown.

After

Width:  |  Height:  |  Size: 85 KiB

View File

@ -1,33 +0,0 @@
![](https://s19.postimg.org/jblfytw9f/laradock-logo.jpg)
[![Build Status](https://travis-ci.org/laradock/laradock.svg?branch=master)](https://travis-ci.org/laradock/laradock) [![GitHub issues](https://img.shields.io/github/issues/laradock/laradock.svg)](https://github.com/laradock/laradock/issues) [![GitHub forks](https://img.shields.io/github/forks/laradock/laradock.svg)](https://github.com/laradock/laradock/network) [![GitHub stars](https://img.shields.io/github/stars/laradock/laradock.svg)](https://github.com/laradock/laradock/stargazers) [![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://raw.githubusercontent.com/laradock/laradock/master/LICENSE)
> Use Docker first and learn about it later.
A Docker PHP development environment that facilitates running **PHP** Apps on **Docker**.
[![forthebadge](http://forthebadge.com/images/badges/built-by-developers.svg)](http://zalt.me)
## Documentation
[**Full Documentation Here**](http://laradock.io)
## Credits
**Maintainers:**
- [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
- Join Us.
## License
[MIT License](https://github.com/laradock/laradock/blob/master/LICENSE) (MIT)

View File

@ -2,15 +2,19 @@ FROM webdevops/apache:ubuntu-16.04
MAINTAINER Eric Pfeiffer <computerfr33k@users.noreply.github.com> 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 EXPOSE 80 443
WORKDIR /var/www/public/ WORKDIR /var/www/
COPY vhost.conf /etc/apache2/sites-enabled/vhost.conf COPY vhost.conf /etc/apache2/sites-enabled/vhost.conf

View File

@ -1,9 +1,9 @@
<VirtualHost *:80> <VirtualHost *:80>
ServerName laradock.dev ServerName laradock.dev
DocumentRoot /var/www/public/ DocumentRoot /var/www/
Options Indexes FollowSymLinks Options Indexes FollowSymLinks
<Directory "/var/www/public/"> <Directory "/var/www/">
AllowOverride All AllowOverride All
<IfVersion < 2.4> <IfVersion < 2.4>
Allow from all Allow from all

1
aws/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
./ssh_keys

17
aws/Dockerfile Normal file
View 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

View File

@ -1,28 +1,30 @@
# Docs: https://caddyserver.com/docs/caddyfile # Docs: https://caddyserver.com/docs/caddyfile
0.0.0.0:80 0.0.0.0:80 {
root /var/www/public root /var/www/public
fastcgi / php-fpm:9000 php { fastcgi / php-fpm:9000 php {
index index.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
#}
} }
laradock.demo {
# To handle .html extensions with laravel change ext to root /var/www/public
# ext / .html
rewrite {
r .*
ext /
to /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
#}

View File

@ -1,15 +1,15 @@
FROM alpine:3.4 FROM alpine:3.5
MAINTAINER Eric Pfeiffer <computerfr33k@users.noreply.github.com> MAINTAINER Eric Pfeiffer <computerfr33k@users.noreply.github.com>
ENV caddy_version=0.10.3 ENV caddy_version=0.10.5
ARG plugins=http.git ARG plugins=http.git
LABEL caddy_version="$caddy_version" architecture="amd64" LABEL caddy_version="$caddy_version" architecture="amd64"
RUN apk update \ RUN apk update \
&& apk upgrade \ && apk upgrade \
&& apk add tar curl git openssh && apk add --no-cache openssh-client git tar curl
RUN curl --silent --show-error --fail --location \ RUN curl --silent --show-error --fail --location \
--header "Accept: application/tar+gzip, application/x-gzip, application/octet-stream" -o - \ --header "Accept: application/tar+gzip, application/x-gzip, application/octet-stream" -o - \

17
docker-compose.sync.yml Normal file
View 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"

View File

@ -19,10 +19,12 @@ services:
- INSTALL_BLACKFIRE=${INSTALL_BLACKFIRE} - INSTALL_BLACKFIRE=${INSTALL_BLACKFIRE}
- INSTALL_SOAP=${WORKSPACE_INSTALL_SOAP} - INSTALL_SOAP=${WORKSPACE_INSTALL_SOAP}
- INSTALL_MONGO=${WORKSPACE_INSTALL_MONGO} - INSTALL_MONGO=${WORKSPACE_INSTALL_MONGO}
- INSTALL_PHPREDIS=${WORKSPACE_INSTALL_PHPREDIS}
- INSTALL_MSSQL=${WORKSPACE_INSTALL_MSSQL} - INSTALL_MSSQL=${WORKSPACE_INSTALL_MSSQL}
- INSTALL_NODE=${WORKSPACE_INSTALL_NODE} - INSTALL_NODE=${WORKSPACE_INSTALL_NODE}
- INSTALL_YARN=${WORKSPACE_INSTALL_YARN} - INSTALL_YARN=${WORKSPACE_INSTALL_YARN}
- INSTALL_DRUSH=${WORKSPACE_INSTALL_DRUSH} - INSTALL_DRUSH=${WORKSPACE_INSTALL_DRUSH}
- INSTALL_DRUPAL_CONSOLE=${WORKSPACE_INSTALL_DRUPAL_CONSOLE}
- INSTALL_AEROSPIKE=${WORKSPACE_INSTALL_AEROSPIKE} - INSTALL_AEROSPIKE=${WORKSPACE_INSTALL_AEROSPIKE}
- INSTALL_V8JS=${WORKSPACE_INSTALL_V8JS} - INSTALL_V8JS=${WORKSPACE_INSTALL_V8JS}
- COMPOSER_GLOBAL_INSTALL=${WORKSPACE_COMPOSER_GLOBAL_INSTALL} - COMPOSER_GLOBAL_INSTALL=${WORKSPACE_COMPOSER_GLOBAL_INSTALL}
@ -32,6 +34,10 @@ services:
- INSTALL_DEPLOYER=${WORKSPACE_INSTALL_DEPLOYER} - INSTALL_DEPLOYER=${WORKSPACE_INSTALL_DEPLOYER}
- INSTALL_LINUXBREW=${WORKSPACE_INSTALL_LINUXBREW} - INSTALL_LINUXBREW=${WORKSPACE_INSTALL_LINUXBREW}
- INSTALL_MC=${WORKSPACE_INSTALL_MC} - 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}
- PUID=${WORKSPACE_PUID} - PUID=${WORKSPACE_PUID}
- PGID=${WORKSPACE_PGID} - PGID=${WORKSPACE_PGID}
- NODE_VERSION=${WORKSPACE_NODE_VERSION} - NODE_VERSION=${WORKSPACE_NODE_VERSION}
@ -75,6 +81,8 @@ services:
- INSTALL_GHOSTSCRIPT=${PHP_FPM_INSTALL_GHOSTSCRIPT} - INSTALL_GHOSTSCRIPT=${PHP_FPM_INSTALL_GHOSTSCRIPT}
- INSTALL_LDAP=${PHP_FPM_INSTALL_LDAP} - INSTALL_LDAP=${PHP_FPM_INSTALL_LDAP}
- INSTALL_SWOOLE=${PHP_FPM_INSTALL_SWOOLE} - INSTALL_SWOOLE=${PHP_FPM_INSTALL_SWOOLE}
- INSTALL_IMAGE_OPTIMIZERS=${PHP_FPM_INSTALL_IMAGE_OPTIMIZERS}
- INSTALL_IMAGEMAGICK=${PHP_FPM_INSTALL_IMAGEMAGICK}
dockerfile: "Dockerfile-${PHP_VERSION}" dockerfile: "Dockerfile-${PHP_VERSION}"
volumes_from: volumes_from:
- applications - applications
@ -96,6 +104,7 @@ services:
php-worker: php-worker:
build: build:
context: ./php-worker context: ./php-worker
dockerfile: "Dockerfile-${PHP_VERSION}"
volumes_from: volumes_from:
- applications - applications
depends_on: depends_on:
@ -105,13 +114,14 @@ services:
networks: networks:
- backend - backend
### Nginx Server Container ################################## ### NGINX Server Container ##################################
nginx: nginx:
build: build:
context: ./nginx context: ./nginx
args: args:
- PHP_UPSTREAM=php-fpm - PHP_UPSTREAM_CONTAINER=${NGINX_PHP_UPSTREAM_CONTAINER}
- PHP_UPSTREAM_PORT=${NGINX_PHP_UPSTREAM_PORT}
volumes_from: volumes_from:
- applications - applications
volumes: volumes:
@ -144,12 +154,14 @@ services:
build: build:
context: ./apache2 context: ./apache2
args: args:
- PHP_SOCKET=${PHP_SOCKET} - PHP_UPSTREAM_CONTAINER=${APACHE_PHP_UPSTREAM_CONTAINER}
- PHP_UPSTREAM_PORT=${APACHE_PHP_UPSTREAM_PORT}
- PHP_UPSTREAM_TIMEOUT=${APACHE_PHP_UPSTREAM_TIMEOUT}
volumes_from: volumes_from:
- applications - applications
volumes: volumes:
- ${APACHE_HOST_LOG_PATH}:/var/log/apache2 - ${APACHE_HOST_LOG_PATH}:/var/log/apache2
- ./apache2/sites:/etc/apache2/sites-available - ${APACHE_SITES_PATH}:/etc/apache2/sites-available
ports: ports:
- "${APACHE_HOST_HTTP_PORT}:80" - "${APACHE_HOST_HTTP_PORT}:80"
- "${APACHE_HOST_HTTPS_PORT}:443" - "${APACHE_HOST_HTTPS_PORT}:443"
@ -192,6 +204,8 @@ services:
mysql: mysql:
build: build:
context: ./mysql context: ./mysql
args:
- MYSQL_VERSION=${MYSQL_VERSION}
environment: environment:
- MYSQL_DATABASE=${MYSQL_DATABASE} - MYSQL_DATABASE=${MYSQL_DATABASE}
- MYSQL_USER=${MYSQL_USER} - MYSQL_USER=${MYSQL_USER}
@ -200,7 +214,7 @@ services:
- TZ=${WORKSPACE_TIMEZONE} - TZ=${WORKSPACE_TIMEZONE}
volumes: volumes:
- ${DATA_SAVE_PATH}/mysql:/var/lib/mysql - ${DATA_SAVE_PATH}/mysql:/var/lib/mysql
- ./mysql/docker-entrypoint-initdb.d:/docker-entrypoint-initdb.d - ${MYSQL_ENTRYPOINT_INITDB}:/docker-entrypoint-initdb.d
ports: ports:
- "${MYSQL_PORT}:3306" - "${MYSQL_PORT}:3306"
networks: networks:
@ -218,7 +232,7 @@ services:
- MYSQL_ROOT_PASSWORD=${PERCONA_ROOT_PASSWORD} - MYSQL_ROOT_PASSWORD=${PERCONA_ROOT_PASSWORD}
volumes: volumes:
- ${DATA_SAVE_PATH}/percona:/var/lib/mysql - ${DATA_SAVE_PATH}/percona:/var/lib/mysql
- ./percona/docker-entrypoint-initdb.d:/docker-entrypoint-initdb.d - ${PERCONA_ENTRYPOINT_INITDB}:/docker-entrypoint-initdb.d
ports: ports:
- "${PERCONA_PORT}:3306" - "${PERCONA_PORT}:3306"
networks: networks:
@ -246,7 +260,7 @@ services:
build: ./mariadb build: ./mariadb
volumes: volumes:
- ${DATA_SAVE_PATH}/mariadb:/var/lib/mysql - ${DATA_SAVE_PATH}/mariadb:/var/lib/mysql
- ./mariadb/docker-entrypoint-initdb.d:/docker-entrypoint-initdb.d - ${MARIADB_ENTRYPOINT_INITDB}:/docker-entrypoint-initdb.d
ports: ports:
- "${MARIADB_PORT}:3306" - "${MARIADB_PORT}:3306"
environment: environment:
@ -330,7 +344,7 @@ services:
volumes: volumes:
- ${DATA_SAVE_PATH}/redis:/data - ${DATA_SAVE_PATH}/redis:/data
ports: ports:
- "6379:6379" - "${REDIS_PORT}:6379"
networks: networks:
- backend - backend
@ -460,12 +474,15 @@ services:
build: ./pgadmin build: ./pgadmin
ports: ports:
- "5050:5050" - "5050:5050"
volumes:
- ${DATA_SAVE_PATH}/pgadmin-backup:/var/lib/pgadmin4/data/storage/pgadmin4
depends_on: depends_on:
- postgres - postgres
networks: networks:
- frontend - frontend
- backend - backend
### ElasticSearch Container ################################# ### ElasticSearch Container #################################
elasticsearch: elasticsearch:
@ -473,6 +490,15 @@ services:
volumes: volumes:
- elasticsearch-data:/usr/share/elasticsearch/data - elasticsearch-data:/usr/share/elasticsearch/data
- elasticsearch-plugins:/usr/share/elasticsearch/plugins - 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: ports:
- "${ELASTICSEARCH_HOST_HTTP_PORT}:9200" - "${ELASTICSEARCH_HOST_HTTP_PORT}:9200"
- "${ELASTICSEARCH_HOST_TRANSPORT_PORT}:9300" - "${ELASTICSEARCH_HOST_TRANSPORT_PORT}:9300"
@ -612,6 +638,16 @@ services:
- frontend - frontend
- backend - backend
### AWS EB-CLI ####
aws:
build:
context: ./aws
volumes_from:
- applications
depends_on:
- workspace
tty: true
### Networks Setup ############################################ ### Networks Setup ############################################
networks: networks:

13
docker-sync.yml Normal file
View 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

View File

@ -32,10 +32,12 @@ PHP_INTERPRETER=php-fpm
WORKSPACE_INSTALL_XDEBUG=false WORKSPACE_INSTALL_XDEBUG=false
WORKSPACE_INSTALL_SOAP=false WORKSPACE_INSTALL_SOAP=false
WORKSPACE_INSTALL_MONGO=false WORKSPACE_INSTALL_MONGO=false
WORKSPACE_INSTALL_PHPREDIS=false
WORKSPACE_INSTALL_MSSQL=false WORKSPACE_INSTALL_MSSQL=false
WORKSPACE_INSTALL_NODE=false WORKSPACE_INSTALL_NODE=false
WORKSPACE_INSTALL_YARN=false WORKSPACE_INSTALL_YARN=false
WORKSPACE_INSTALL_DRUSH=false WORKSPACE_INSTALL_DRUSH=false
WORKSPACE_INSTALL_DRUPAL_CONSOLE=false
WORKSPACE_INSTALL_AEROSPIKE=false WORKSPACE_INSTALL_AEROSPIKE=false
WORKSPACE_INSTALL_V8JS=false WORKSPACE_INSTALL_V8JS=false
WORKSPACE_COMPOSER_GLOBAL_INSTALL=false WORKSPACE_COMPOSER_GLOBAL_INSTALL=false
@ -45,6 +47,10 @@ WORKSPACE_INSTALL_LARAVEL_INSTALLER=false
WORKSPACE_INSTALL_DEPLOYER=false WORKSPACE_INSTALL_DEPLOYER=false
WORKSPACE_INSTALL_LINUXBREW=false WORKSPACE_INSTALL_LINUXBREW=false
WORKSPACE_INSTALL_MC=false WORKSPACE_INSTALL_MC=false
WORKSPACE_INSTALL_SYMFONY=false
WORKSPACE_INSTALL_PYTHON=false
WORKSPACE_INSTALL_IMAGE_OPTIMIZERS=false
WORKSPACE_INSTALL_IMAGEMAGICK=false
WORKSPACE_PUID=1000 WORKSPACE_PUID=1000
WORKSPACE_PGID=1000 WORKSPACE_PGID=1000
WORKSPACE_NODE_VERSION=stable WORKSPACE_NODE_VERSION=stable
@ -71,6 +77,8 @@ PHP_FPM_INSTALL_INTL=false
PHP_FPM_INSTALL_GHOSTSCRIPT=false PHP_FPM_INSTALL_GHOSTSCRIPT=false
PHP_FPM_INSTALL_LDAP=false PHP_FPM_INSTALL_LDAP=false
PHP_FPM_INSTALL_SWOOLE=false PHP_FPM_INSTALL_SWOOLE=false
PHP_FPM_INSTALL_IMAGE_OPTIMIZERS=false
PHP_FPM_INSTALL_IMAGEMAGICK=false
### NGINX ############################################################################################################## ### NGINX ##############################################################################################################
@ -78,22 +86,32 @@ NGINX_HOST_HTTP_PORT=80
NGINX_HOST_HTTPS_PORT=443 NGINX_HOST_HTTPS_PORT=443
NGINX_HOST_LOG_PATH=./logs/nginx/ NGINX_HOST_LOG_PATH=./logs/nginx/
NGINX_SITES_PATH=./nginx/sites/ NGINX_SITES_PATH=./nginx/sites/
NGINX_PHP_UPSTREAM_CONTAINER=php-fpm
NGINX_PHP_UPSTREAM_PORT=9000
### APACHE ############################################################################################################# ### APACHE #############################################################################################################
APACHE_HOST_HTTP_PORT=80 APACHE_HOST_HTTP_PORT=80
APACHE_HOST_HTTPS_PORT=443 APACHE_HOST_HTTPS_PORT=443
APACHE2_PHP_SOCKET=php-fpm:9000
APACHE_HOST_LOG_PATH=./logs/apache2 APACHE_HOST_LOG_PATH=./logs/apache2
PHP_SOCKET=php-fpm:9000 APACHE_SITES_PATH=./apache2/sites
APACHE_PHP_UPSTREAM_CONTAINER=php-fpm
APACHE_PHP_UPSTREAM_PORT=9000
APACHE_PHP_UPSTREAM_TIMEOUT=60
### MYSQL ############################################################################################################## ### MYSQL ##############################################################################################################
MYSQL_VERSION=8.0
MYSQL_DATABASE=default MYSQL_DATABASE=default
MYSQL_USER=default MYSQL_USER=default
MYSQL_PASSWORD=secret MYSQL_PASSWORD=secret
MYSQL_PORT=3306 MYSQL_PORT=3306
MYSQL_ROOT_PASSWORD=root MYSQL_ROOT_PASSWORD=root
MYSQL_ENTRYPOINT_INITDB=./mysql/docker-entrypoint-initdb.d
### REDIS ##############################################################################################################
REDIS_PORT=6379
### Percona ############################################################################################################ ### Percona ############################################################################################################
@ -102,6 +120,7 @@ PERCONA_USER=homestead
PERCONA_PASSWORD=secret PERCONA_PASSWORD=secret
PERCONA_PORT=3306 PERCONA_PORT=3306
PERCONA_ROOT_PASSWORD=root PERCONA_ROOT_PASSWORD=root
PERCONA_ENTRYPOINT_INITDB=./percona/docker-entrypoint-initdb.d
### MSSQL ############################################################################################################## ### MSSQL ##############################################################################################################
@ -116,6 +135,7 @@ MARIADB_USER=default
MARIADB_PASSWORD=secret MARIADB_PASSWORD=secret
MARIADB_PORT=3306 MARIADB_PORT=3306
MARIADB_ROOT_PASSWORD=root MARIADB_ROOT_PASSWORD=root
MARIADB_ENTRYPOINT_INITDB=./mariadb/docker-entrypoint-initdb.d
### POSTGRES ########################################################################################################### ### POSTGRES ###########################################################################################################
@ -249,6 +269,13 @@ CADDY_CUSTOM_CADDYFILE=./caddy/Caddyfile
LARAVEL_ECHO_SERVER_PORT=6001 LARAVEL_ECHO_SERVER_PORT=6001
### DOCKER-SYNC ################################################################################################
# osx: 'native_osx' (default)
# windows: 'unison'
# linux: docker-sync not required
DOCKER_SYNC_STRATEGY=native_osx
##### TO BE CONTINUE ................................. ##### TO BE CONTINUE .................................
@ -256,8 +283,6 @@ LARAVEL_ECHO_SERVER_PORT=6001
# ......... # .........
# ......... # .........
############################ ############################
# Miscellaneous # Miscellaneous
############################ ############################
@ -275,3 +300,4 @@ PHP_IDE_CONFIG=serverName=laradock
# Fix for windows users to make sure the application path works. # Fix for windows users to make sure the application path works.
COMPOSE_CONVERT_WINDOWS_PATHS=1 COMPOSE_CONVERT_WINDOWS_PATHS=1

View File

@ -1,4 +1,5 @@
FROM mysql:5.7 ARG MYSQL_VERSION=8.0
FROM mysql:${MYSQL_VERSION}
MAINTAINER Mahmoud Zalt <mahmoud@zalt.me> MAINTAINER Mahmoud Zalt <mahmoud@zalt.me>

View File

@ -1,20 +1,20 @@
### #
### Copy createdb.sql.example to createdb.sql # Copy createdb.sql.example to createdb.sql
### then uncomment then set database name and username to create you need databases # then uncomment then set database name and username to create you need databases
# #
# example: .env MYSQL_USER=appuser and need db name is myshop_db # example: .env MYSQL_USER=appuser and need db name is myshop_db
# #
# CREATE DATABASE IF NOT EXISTS `myshop_db` ; # CREATE DATABASE IF NOT EXISTS `myshop_db` ;
# GRANT ALL ON `myshop_db`.* TO 'appuser'@'%' ; # GRANT ALL ON `myshop_db`.* TO 'appuser'@'%' ;
# #
### #
### this sql script is auto run when mysql container start and $DATA_SAVE_PATH/mysql not exists. # this sql script will auto run when the mysql container starts and the $DATA_SAVE_PATH/mysql not found.
### #
### if your $DATA_SAVE_PATH/mysql is exists and you do not want to delete it, you can run by manual execution: # if your $DATA_SAVE_PATH/mysql exists and you do not want to delete it, you can run by manual execution:
### #
### docker-compose exec mysql bash # docker-compose exec mysql bash
### mysql -u root -p < /docker-entrypoint-initdb.d/createdb.sql # mysql -u root -p < /docker-entrypoint-initdb.d/createdb.sql
### #
#CREATE DATABASE IF NOT EXISTS `dev_db_1` COLLATE 'utf8_general_ci' ; #CREATE DATABASE IF NOT EXISTS `dev_db_1` COLLATE 'utf8_general_ci' ;
#GRANT ALL ON `dev_db_1`.* TO 'default'@'%' ; #GRANT ALL ON `dev_db_1`.* TO 'default'@'%' ;

View File

@ -7,3 +7,4 @@
[mysqld] [mysqld]
sql-mode="STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION" sql-mode="STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"
character-set-server=utf8

View File

@ -4,7 +4,8 @@ MAINTAINER Mahmoud Zalt <mahmoud@zalt.me>
ADD nginx.conf /etc/nginx/ ADD nginx.conf /etc/nginx/
ARG PHP_UPSTREAM=php-fpm ARG PHP_UPSTREAM_CONTAINER=php-fpm
ARG PHP_UPSTREAM_PORT=9000
# fix a problem--#397, change application source from dl-cdn.alpinelinux.org to aliyun source. # fix a problem--#397, change application source from dl-cdn.alpinelinux.org to aliyun source.
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/' /etc/apk/repositories RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/' /etc/apk/repositories
@ -12,9 +13,11 @@ RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/' /etc/apk/repositories
RUN apk update \ RUN apk update \
&& apk upgrade \ && apk upgrade \
&& apk add --no-cache bash \ && apk add --no-cache bash \
&& adduser -D -H -u 1000 -s /bin/bash www-data \ && adduser -D -H -u 1000 -s /bin/bash www-data
&& rm /etc/nginx/conf.d/default.conf \
&& echo "upstream php-upstream { server ${PHP_UPSTREAM}:9000; }" > /etc/nginx/conf.d/upstream.conf # Set upstream conf and remove the default conf
RUN echo "upstream php-upstream { server ${PHP_UPSTREAM_CONTAINER}:${PHP_UPSTREAM_PORT}; }" > /etc/nginx/conf.d/upstream.conf \
&& rm /etc/nginx/conf.d/default.conf
CMD ["nginx"] CMD ["nginx"]

View File

@ -3,8 +3,8 @@ server {
listen 80; listen 80;
listen [::]:80; listen [::]:80;
server_name project-1.dev; server_name app.dev;
root /var/www/project-1/public; root /var/www/app;
index index.php index.html index.htm; index index.php index.html index.htm;
location / { location / {
@ -29,4 +29,7 @@ server {
root /var/www/letsencrypt/; root /var/www/letsencrypt/;
log_not_found off; log_not_found off;
} }
error_log /var/log/nginx/app_error.log;
access_log /var/log/nginx/app_access.log;
} }

View File

@ -3,8 +3,8 @@ server {
listen 80; listen 80;
listen [::]:80; listen [::]:80;
server_name project-2.dev; server_name laravel.dev;
root /var/www/project-2/public; root /var/www/laravel/public;
index index.php index.html index.htm; index index.php index.html index.htm;
location / { location / {
@ -29,4 +29,7 @@ server {
root /var/www/letsencrypt/; root /var/www/letsencrypt/;
log_not_found off; log_not_found off;
} }
error_log /var/log/nginx/laravel_error.log;
access_log /var/log/nginx/laravel_access.log;
} }

View File

@ -0,0 +1,28 @@
server {
listen 80;
listen [::]:80;
server_name symfony.dev;
root /var/www/projects/symfony/web;
index index.php index.html index.htm;
location / {
try_files $uri @rewriteapp;
}
location @rewriteapp {
rewrite ^(.*)$ /app.php/$1 last;
}
location ~ ^/(app|app_dev|config)\.php(/|$) {
fastcgi_pass php-upstream;
fastcgi_split_path_info ^(.+\.php)(/.*)$;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param HTTPS off;
}
error_log /var/log/nginx/symfony_error.log;
access_log /var/log/nginx/symfony_access.log;
}

View File

@ -1,5 +1,10 @@
FROM fenglc/pgadmin4 FROM fenglc/pgadmin4
MAINTAINER Bo-Yi Wu <appleboy.tw@gmail.com> MAINTAINER Huadong Zuo <admin@zuohuadong.cn>
# user: pgadmin4@pgadmin.org
# password: admin
# pg_dump in "/usr/bin"
# backup in "/var/lib/pgadmin4/data/storage/pgadmin4/"
EXPOSE 5050 EXPOSE 5050

View File

@ -87,7 +87,7 @@ RUN if [ ${INSTALL_XDEBUG} = false -a ${INSTALL_BLACKFIRE} = true ]; then \
ARG INSTALL_PHPREDIS=false ARG INSTALL_PHPREDIS=false
RUN if [ ${INSTALL_PHPREDIS} = true ]; then \ RUN if [ ${INSTALL_PHPREDIS} = true ]; then \
# Install Php Redis Extension # Install Php Redis Extension
pecl install -o -f redis \ printf "\n" | pecl install -o -f redis \
&& rm -rf /tmp/pear \ && rm -rf /tmp/pear \
&& docker-php-ext-enable redis \ && docker-php-ext-enable redis \
;fi ;fi
@ -258,6 +258,30 @@ RUN if [ ${INSTALL_MSSQL} = true ]; then \
docker-php-ext-enable mssql pdo pdo_dblib \ docker-php-ext-enable mssql pdo pdo_dblib \
;fi ;fi
#####################################
# Image optimizers:
#####################################
USER root
ARG INSTALL_IMAGE_OPTIMIZERS=false
ENV INSTALL_IMAGE_OPTIMIZERS ${INSTALL_IMAGE_OPTIMIZERS}
RUN if [ ${INSTALL_IMAGE_OPTIMIZERS} = true ]; then \
apt-get update -yqq && \
apt-get install -y --force-yes jpegoptim optipng pngquant gifsicle \
;fi
#####################################
# ImageMagick:
#####################################
USER root
ARG INSTALL_IMAGEMAGICK=false
ENV INSTALL_IMAGEMAGICK ${INSTALL_IMAGEMAGICK}
RUN if [ ${INSTALL_IMAGEMAGICK} = true ]; then \
apt-get update -y && \
apt-get install -y libmagickwand-dev imagemagick && \
pecl install imagick && \
docker-php-ext-enable imagick \
;fi
# #
#-------------------------------------------------------------------------- #--------------------------------------------------------------------------
# Final Touch # Final Touch
@ -265,7 +289,7 @@ RUN if [ ${INSTALL_MSSQL} = true ]; then \
# #
ADD ./laravel.ini /usr/local/etc/php/conf.d ADD ./laravel.ini /usr/local/etc/php/conf.d
ADD ./laravel.pool.conf /usr/local/etc/php-fpm.d/ ADD ./xlaravel.pool.conf /usr/local/etc/php-fpm.d/
#RUN rm -r /var/lib/apt/lists/* #RUN rm -r /var/lib/apt/lists/*

View File

@ -84,7 +84,7 @@ RUN if [ ${INSTALL_XDEBUG} = false -a ${INSTALL_BLACKFIRE} = true ]; then \
ARG INSTALL_PHPREDIS=false ARG INSTALL_PHPREDIS=false
RUN if [ ${INSTALL_PHPREDIS} = true ]; then \ RUN if [ ${INSTALL_PHPREDIS} = true ]; then \
# Install Php Redis Extension # Install Php Redis Extension
pecl install -o -f redis \ printf "\n" | pecl install -o -f redis \
&& rm -rf /tmp/pear \ && rm -rf /tmp/pear \
&& docker-php-ext-enable redis \ && docker-php-ext-enable redis \
;fi ;fi
@ -282,6 +282,30 @@ RUN if [ ${INSTALL_MSSQL} = true ]; then \
&& docker-php-ext-enable pdo_sqlsrv sqlsrv \ && docker-php-ext-enable pdo_sqlsrv sqlsrv \
;fi ;fi
#####################################
# Image optimizers:
#####################################
USER root
ARG INSTALL_IMAGE_OPTIMIZERS=false
ENV INSTALL_IMAGE_OPTIMIZERS ${INSTALL_IMAGE_OPTIMIZERS}
RUN if [ ${INSTALL_IMAGE_OPTIMIZERS} = true ]; then \
apt-get update -yqq && \
apt-get install -y --force-yes jpegoptim optipng pngquant gifsicle \
;fi
#####################################
# ImageMagick:
#####################################
USER root
ARG INSTALL_IMAGEMAGICK=false
ENV INSTALL_IMAGEMAGICK ${INSTALL_IMAGEMAGICK}
RUN if [ ${INSTALL_IMAGEMAGICK} = true ]; then \
apt-get update -y && \
apt-get install -y libmagickwand-dev imagemagick && \
pecl install imagick && \
docker-php-ext-enable imagick \
;fi
# #
#-------------------------------------------------------------------------- #--------------------------------------------------------------------------
# Final Touch # Final Touch
@ -289,7 +313,7 @@ RUN if [ ${INSTALL_MSSQL} = true ]; then \
# #
ADD ./laravel.ini /usr/local/etc/php/conf.d/ ADD ./laravel.ini /usr/local/etc/php/conf.d/
ADD ./laravel.pool.conf /usr/local/etc/php-fpm.d/ ADD ./xlaravel.pool.conf /usr/local/etc/php-fpm.d/
#RUN rm -r /var/lib/apt/lists/* #RUN rm -r /var/lib/apt/lists/*

View File

@ -78,13 +78,13 @@ RUN if [ ${INSTALL_XDEBUG} = false -a ${INSTALL_BLACKFIRE} = true ]; then \
;fi ;fi
##################################### #####################################
# PHP REDIS EXTENSION FOR PHP 7 # PHP REDIS EXTENSION FOR PHP 7.0
##################################### #####################################
ARG INSTALL_PHPREDIS=false ARG INSTALL_PHPREDIS=false
RUN if [ ${INSTALL_PHPREDIS} = true ]; then \ RUN if [ ${INSTALL_PHPREDIS} = true ]; then \
# Install Php Redis Extension # Install Php Redis Extension
pecl install -o -f redis \ printf "\n" | pecl install -o -f redis \
&& rm -rf /tmp/pear \ && rm -rf /tmp/pear \
&& docker-php-ext-enable redis \ && docker-php-ext-enable redis \
;fi ;fi
@ -289,6 +289,30 @@ RUN if [ ${INSTALL_MSSQL} = true ]; then \
&& docker-php-ext-enable pdo_sqlsrv sqlsrv \ && docker-php-ext-enable pdo_sqlsrv sqlsrv \
;fi ;fi
#####################################
# Image optimizers:
#####################################
USER root
ARG INSTALL_IMAGE_OPTIMIZERS=false
ENV INSTALL_IMAGE_OPTIMIZERS ${INSTALL_IMAGE_OPTIMIZERS}
RUN if [ ${INSTALL_IMAGE_OPTIMIZERS} = true ]; then \
apt-get update -yqq && \
apt-get install -y --force-yes jpegoptim optipng pngquant gifsicle \
;fi
#####################################
# ImageMagick:
#####################################
USER root
ARG INSTALL_IMAGEMAGICK=false
ENV INSTALL_IMAGEMAGICK ${INSTALL_IMAGEMAGICK}
RUN if [ ${INSTALL_IMAGEMAGICK} = true ]; then \
apt-get update -y && \
apt-get install -y libmagickwand-dev imagemagick && \
pecl install imagick && \
docker-php-ext-enable imagick \
;fi
# #
#-------------------------------------------------------------------------- #--------------------------------------------------------------------------
# Final Touch # Final Touch
@ -296,7 +320,7 @@ RUN if [ ${INSTALL_MSSQL} = true ]; then \
# #
ADD ./laravel.ini /usr/local/etc/php/conf.d ADD ./laravel.ini /usr/local/etc/php/conf.d
ADD ./laravel.pool.conf /usr/local/etc/php-fpm.d/ ADD ./xlaravel.pool.conf /usr/local/etc/php-fpm.d/
#RUN rm -r /var/lib/apt/lists/* #RUN rm -r /var/lib/apt/lists/*

View File

@ -3,14 +3,30 @@
# Image Setup # Image Setup
#-------------------------------------------------------------------------- #--------------------------------------------------------------------------
# #
# To take a look at the'php-worker' base Image, visit its DockerHub page
# https://hub.docker.com/r/nielsvdoorn/laravel-supervisor/
#
FROM nielsvdoorn/laravel-supervisor FROM php:7.0-alpine
MAINTAINER Mahmoud Zalt <mahmoud@zalt.me> MAINTAINER Mahmoud Zalt <mahmoud@zalt.me>
RUN apk --update add wget \
curl \
git \
build-base \
libmemcached-dev \
libmcrypt-dev \
libxml2-dev \
zlib-dev \
autoconf \
cyrus-sasl-dev \
libgsasl-dev \
supervisor
RUN docker-php-ext-install mysqli mbstring pdo pdo_mysql mcrypt tokenizer xml
RUN pecl channel-update pecl.php.net && pecl install memcached && docker-php-ext-enable memcached
RUN rm /var/cache/apk/* \
&& mkdir -p /var/www
# #
#-------------------------------------------------------------------------- #--------------------------------------------------------------------------
# Optional Supervisord Configuration # Optional Supervisord Configuration
@ -19,7 +35,10 @@ MAINTAINER Mahmoud Zalt <mahmoud@zalt.me>
# Modify the ./supervisor.conf file to match your App's requirements. # Modify the ./supervisor.conf file to match your App's requirements.
# Make sure you rebuild your container with every change. # Make sure you rebuild your container with every change.
# #
COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf
COPY supervisord.conf /etc/supervisord.conf
ENTRYPOINT ["/usr/bin/supervisord", "-n", "-c", "/etc/supervisord.conf"]
# #
#-------------------------------------------------------------------------- #--------------------------------------------------------------------------
@ -37,5 +56,4 @@ COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf
#-------------------------------------------------------------------------- #--------------------------------------------------------------------------
# #
RUN rm -r /var/lib/apt/lists/*
WORKDIR /etc/supervisor/conf.d/ WORKDIR /etc/supervisor/conf.d/

59
php-worker/Dockerfile-71 Normal file
View File

@ -0,0 +1,59 @@
#
#--------------------------------------------------------------------------
# Image Setup
#--------------------------------------------------------------------------
#
FROM php:7.1-alpine
MAINTAINER Mahmoud Zalt <mahmoud@zalt.me>
RUN apk --update add wget \
curl \
git \
build-base \
libmemcached-dev \
libmcrypt-dev \
libxml2-dev \
zlib-dev \
autoconf \
cyrus-sasl-dev \
libgsasl-dev \
supervisor
RUN docker-php-ext-install mysqli mbstring pdo pdo_mysql mcrypt tokenizer xml
RUN pecl channel-update pecl.php.net && pecl install memcached && docker-php-ext-enable memcached
RUN rm /var/cache/apk/* \
&& mkdir -p /var/www
#
#--------------------------------------------------------------------------
# Optional Supervisord Configuration
#--------------------------------------------------------------------------
#
# Modify the ./supervisor.conf file to match your App's requirements.
# Make sure you rebuild your container with every change.
#
COPY supervisord.conf /etc/supervisord.conf
ENTRYPOINT ["/usr/bin/supervisord", "-n", "-c", "/etc/supervisord.conf"]
#
#--------------------------------------------------------------------------
# Optional Software's Installation
#--------------------------------------------------------------------------
#
# If you need to modify this image, feel free to do it right here.
#
# -- Your awesome modifications go here -- #
#
#--------------------------------------------------------------------------
# Final Touch
#--------------------------------------------------------------------------
#
WORKDIR /etc/supervisor/conf.d/

89
sync.sh Executable file
View File

@ -0,0 +1,89 @@
#!/bin/bash
# This shell script is an optional tool to simplify
# the installation and usage of laradock with docker-sync.
# Make sure that the DOCKER_SYNC_STRATEGY is set in the .env
# DOCKER_SYNC_STRATEGY=native_osx # osx
# DOCKER_SYNC_STRATEGY=unison # windows
# To run, make sure to add permissions to this file:
# chmod 755 sync.sh
# USAGE EXAMPLE:
# Install docker-sync: ./sync.sh install
# Start sync and services with nginx and mysql: ./sync.sh up nginx mysql
# Stop containers and sync: ./sync.sh down
# prints colored text
print_style () {
if [ "$2" == "info" ] ; then
COLOR="96m"
elif [ "$2" == "success" ] ; then
COLOR="92m"
elif [ "$2" == "warning" ] ; then
COLOR="93m"
elif [ "$2" == "danger" ] ; then
COLOR="91m"
else #default color
COLOR="0m"
fi
STARTCOLOR="\e[$COLOR"
ENDCOLOR="\e[0m"
printf "$STARTCOLOR%b$ENDCOLOR" "$1"
}
display_options () {
printf "Available options:\n";
print_style " install" "info"; printf "\t\t Installs docker-sync gem on the host machine.\n"
print_style " up [services]" "success"; printf "\t Starts docker-sync and runs docker compose.\n"
print_style " down" "success"; printf "\t\t\t Stops containers and docker-sync.\n"
print_style " bash" "success"; printf "\t\t\t Opens bash on the workspace.\n"
print_style " sync" "info"; printf "\t\t\t Manually triggers the synchronization of files.\n"
print_style " clean" "danger"; printf "\t\t Removes all files from docker-sync.\n"
}
if [[ $# -eq 0 ]] ; then
print_style "Missing arguments.\n" "danger"
display_options
exit 1
fi
if [ "$1" == "up" ] ; then
print_style "Initializing Docker Sync\n" "info"
print_style "May take a long time (15min+) on the first run\n" "info"
docker-sync start;
print_style "Initializing Docker Compose\n" "info"
shift # removing first argument
docker-compose -f docker-compose.yml -f docker-compose.sync.yml up -d ${@}
elif [ "$1" == "down" ]; then
print_style "Stopping Docker Compose\n" "info"
docker-compose down
print_style "Stopping Docker Sync\n" "info"
docker-sync stop
elif [ "$1" == "bash" ]; then
docker-compose exec workspace bash
elif [ "$1" == "install" ]; then
print_style "Installing docker-sync\n" "info"
gem install docker-sync
elif [ "$1" == "sync" ]; then
print_style "Manually triggering sync between host and docker-sync container.\n" "info"
docker-sync sync;
elif [ "$1" == "clean" ]; then
print_style "Removing and cleaning up files from the docker-sync container.\n" "warning"
docker-sync clean
else
print_style "Invalid arguments.\n" "danger"
display_options
exit 1
fi

View File

@ -26,7 +26,7 @@ if [ -n "${HUGO_VERSION}" ]; then
# Download hugo binary # Download hugo binary
curl -L https://github.com/spf13/hugo/releases/download/v$HUGO_VERSION/$HUGO_PACKAGE.tar.gz | tar xz curl -L https://github.com/spf13/hugo/releases/download/v$HUGO_VERSION/$HUGO_PACKAGE.tar.gz | tar xz
mkdir $HOME/bin mkdir -p $HOME/bin
mv ./${HUGO_BIN}/${HUGO_BIN} $HOME/bin/hugo mv ./${HUGO_BIN}/${HUGO_BIN} $HOME/bin/hugo
# Remove existing docs # Remove existing docs

View File

@ -194,6 +194,19 @@ RUN if [ ${INSTALL_MONGO} = true ]; then \
ln -s /etc/php/5.6/mods-available/mongodb.ini /etc/php/5.6/cli/conf.d/30-mongodb.ini \ ln -s /etc/php/5.6/mods-available/mongodb.ini /etc/php/5.6/cli/conf.d/30-mongodb.ini \
;fi ;fi
#####################################
# PHP REDIS EXTENSION FOR PHP 5.6
#####################################
ARG INSTALL_PHPREDIS=false
ENV INSTALL_PHPREDIS ${INSTALL_PHPREDIS}
RUN if [ ${INSTALL_PHPREDIS} = true ]; then \
# Install Php Redis extension
printf "\n" | pecl -q install -o -f redis && \
echo "extension=redis.so" >> /etc/php/5.6/mods-available/redis.ini && \
phpenmod redis \
;fi
##################################### #####################################
# Drush: # Drush:
##################################### #####################################
@ -202,12 +215,28 @@ ENV DRUSH_VERSION 8.1.2
ARG INSTALL_DRUSH=false ARG INSTALL_DRUSH=false
ENV INSTALL_DRUSH ${INSTALL_DRUSH} ENV INSTALL_DRUSH ${INSTALL_DRUSH}
RUN if [ ${INSTALL_DRUSH} = true ]; then \ RUN if [ ${INSTALL_DRUSH} = true ]; then \
apt-get update -yqq && \
apt-get -y install mysql-client && \
# Install Drush 8 with the phar file. # Install Drush 8 with the phar file.
curl -fsSL -o /usr/local/bin/drush https://github.com/drush-ops/drush/releases/download/$DRUSH_VERSION/drush.phar | bash && \ curl -fsSL -o /usr/local/bin/drush https://github.com/drush-ops/drush/releases/download/$DRUSH_VERSION/drush.phar | bash && \
chmod +x /usr/local/bin/drush && \ chmod +x /usr/local/bin/drush && \
drush core-status \ drush core-status \
;fi ;fi
#####################################
# Drupal Console:
#####################################
USER root
ARG INSTALL_DRUPAL_CONSOLE=false
ENV INSTALL_DRUPAL_CONSOLE ${INSTALL_DRUPAL_CONSOLE}
RUN if [ ${INSTALL_DRUPAL_CONSOLE} = true ]; then \
apt-get update -yqq && \
apt-get -y install mysql-client && \
curl https://drupalconsole.com/installer -L -o drupal.phar && \
mv drupal.phar /usr/local/bin/drupal && \
chmod +x /usr/local/bin/drupal \
;fi
USER laradock USER laradock
##################################### #####################################
@ -247,6 +276,9 @@ RUN if [ ${INSTALL_NODE} = true ]; then \
echo '[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm' >> ~/.bashrc \ echo '[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm' >> ~/.bashrc \
;fi ;fi
# Add PATH for node
ENV PATH $PATH:$NVM_DIR/versions/node/v${NODE_VERSION}/bin
##################################### #####################################
# YARN: # YARN:
##################################### #####################################
@ -317,14 +349,6 @@ USER laradock
RUN echo "" >> ~/.bashrc && \ RUN echo "" >> ~/.bashrc && \
echo 'export PATH="/var/www/vendor/bin:$PATH"' >> ~/.bashrc echo 'export PATH="/var/www/vendor/bin:$PATH"' >> ~/.bashrc
#####################################
# Laravel Artisan Alias
#####################################
USER root
RUN echo "" >> ~/.bashrc && \
echo 'alias art="php artisan"' >> ~/.bashrc
##################################### #####################################
# Laravel Envoy: # Laravel Envoy:
##################################### #####################################
@ -425,8 +449,66 @@ RUN if [ ${INSTALL_MC} = true ]; then\
chmod +x /usr/local/bin/mc \ chmod +x /usr/local/bin/mc \
;fi ;fi
#####################################
# Image optimizers:
#####################################
USER root
ARG INSTALL_IMAGE_OPTIMIZERS=false
ENV INSTALL_IMAGE_OPTIMIZERS ${INSTALL_IMAGE_OPTIMIZERS}
RUN if [ ${INSTALL_IMAGE_OPTIMIZERS} = true ]; then \
apt-get install -y --force-yes jpegoptim optipng pngquant gifsicle && \
if [ ${INSTALL_NODE} = true ]; then \
. ~/.bashrc && npm install -g svgo \
;fi\
;fi
USER laradock USER laradock
#####################################
# Symfony:
#####################################
USER root
ARG INSTALL_SYMFONY=false
ENV INSTALL_SYMFONY ${INSTALL_SYMFONY}
RUN if [ ${INSTALL_SYMFONY} = true ]; then \
mkdir -p /usr/local/bin \
&& curl -LsS https://symfony.com/installer -o /usr/local/bin/symfony \
&& chmod a+x /usr/local/bin/symfony \
# Symfony 3 alias
&& echo 'alias dev="php bin/console -e=dev"' >> ~/.bashrc \
&& echo 'alias prod="php bin/console -e=prod"' >> ~/.bashrc \
# Symfony 2 alias
# && echo 'alias dev="php app/console -e=dev"' >> ~/.bashrc \
# && echo 'alias prod="php app/console -e=prod"' >> ~/.bashrc \
;fi
#####################################
# PYTHON:
#####################################
ARG INSTALL_PYTHON=false
ENV INSTALL_PYTHON ${INSTALL_PYTHON}
RUN if [ ${INSTALL_PYTHON} = true ]; then \
apt-get update \
&& apt-get -y install python python-pip python-dev build-essential \
&& pip install --upgrade pip \
&& pip install --upgrade virtualenv \
;fi
#####################################
# ImageMagick:
#####################################
USER root
ARG INSTALL_IMAGEMAGICK=false
ENV INSTALL_IMAGEMAGICK ${INSTALL_IMAGEMAGICK}
RUN if [ ${INSTALL_IMAGEMAGICK} = true ]; then \
apt-get install -y --force-yes imagemagick php-imagick \
;fi
# #
#-------------------------------------------------------------------------- #--------------------------------------------------------------------------
# Final Touch # Final Touch

View File

@ -194,6 +194,19 @@ RUN if [ ${INSTALL_MONGO} = true ]; then \
ln -s /etc/php/7.0/mods-available/mongodb.ini /etc/php/7.0/cli/conf.d/30-mongodb.ini \ ln -s /etc/php/7.0/mods-available/mongodb.ini /etc/php/7.0/cli/conf.d/30-mongodb.ini \
;fi ;fi
#####################################
# PHP REDIS EXTENSION FOR PHP 7
#####################################
ARG INSTALL_PHPREDIS=false
ENV INSTALL_PHPREDIS ${INSTALL_PHPREDIS}
RUN if [ ${INSTALL_PHPREDIS} = true ]; then \
# Install Php Redis extension
printf "\n" | pecl -q install -o -f redis && \
echo "extension=redis.so" >> /etc/php/7.0/mods-available/redis.ini && \
phpenmod redis \
;fi
##################################### #####################################
# Drush: # Drush:
##################################### #####################################
@ -202,12 +215,28 @@ ENV DRUSH_VERSION 8.1.2
ARG INSTALL_DRUSH=false ARG INSTALL_DRUSH=false
ENV INSTALL_DRUSH ${INSTALL_DRUSH} ENV INSTALL_DRUSH ${INSTALL_DRUSH}
RUN if [ ${INSTALL_DRUSH} = true ]; then \ RUN if [ ${INSTALL_DRUSH} = true ]; then \
apt-get update -yqq && \
apt-get -y install mysql-client && \
# Install Drush 8 with the phar file. # Install Drush 8 with the phar file.
curl -fsSL -o /usr/local/bin/drush https://github.com/drush-ops/drush/releases/download/$DRUSH_VERSION/drush.phar | bash && \ curl -fsSL -o /usr/local/bin/drush https://github.com/drush-ops/drush/releases/download/$DRUSH_VERSION/drush.phar | bash && \
chmod +x /usr/local/bin/drush && \ chmod +x /usr/local/bin/drush && \
drush core-status \ drush core-status \
;fi ;fi
#####################################
# Drupal Console:
#####################################
USER root
ARG INSTALL_DRUPAL_CONSOLE=false
ENV INSTALL_DRUPAL_CONSOLE ${INSTALL_DRUPAL_CONSOLE}
RUN if [ ${INSTALL_DRUPAL_CONSOLE} = true ]; then \
apt-get update -yqq && \
apt-get -y install mysql-client && \
curl https://drupalconsole.com/installer -L -o drupal.phar && \
mv drupal.phar /usr/local/bin/drupal && \
chmod +x /usr/local/bin/drupal \
;fi
USER laradock USER laradock
##################################### #####################################
@ -247,6 +276,9 @@ RUN if [ ${INSTALL_NODE} = true ]; then \
echo '[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm' >> ~/.bashrc \ echo '[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm' >> ~/.bashrc \
;fi ;fi
# Add PATH for node
ENV PATH $PATH:$NVM_DIR/versions/node/v${NODE_VERSION}/bin
##################################### #####################################
# YARN: # YARN:
##################################### #####################################
@ -334,14 +366,6 @@ USER laradock
RUN echo "" >> ~/.bashrc && \ RUN echo "" >> ~/.bashrc && \
echo 'export PATH="/var/www/vendor/bin:$PATH"' >> ~/.bashrc echo 'export PATH="/var/www/vendor/bin:$PATH"' >> ~/.bashrc
#####################################
# Laravel Artisan Alias
#####################################
USER root
RUN echo "" >> ~/.bashrc && \
echo 'alias art="php artisan"' >> ~/.bashrc
##################################### #####################################
# Laravel Envoy: # Laravel Envoy:
##################################### #####################################
@ -508,6 +532,19 @@ RUN if [ ${INSTALL_MC} = true ]; then\
chmod +x /usr/local/bin/mc \ chmod +x /usr/local/bin/mc \
;fi ;fi
#####################################
# Image optimizers:
#####################################
USER root
ARG INSTALL_IMAGE_OPTIMIZERS=false
ENV INSTALL_IMAGE_OPTIMIZERS ${INSTALL_IMAGE_OPTIMIZERS}
RUN if [ ${INSTALL_IMAGE_OPTIMIZERS} = true ]; then \
apt-get install -y --force-yes jpegoptim optipng pngquant gifsicle && \
if [ ${INSTALL_NODE} = true ]; then \
. ~/.bashrc && npm install -g svgo \
;fi\
;fi
##################################### #####################################
# Symfony: # Symfony:
##################################### #####################################
@ -530,6 +567,29 @@ RUN if [ ${INSTALL_SYMFONY} = true ]; then \
;fi ;fi
#####################################
# PYTHON:
#####################################
ARG INSTALL_PYTHON=false
ENV INSTALL_PYTHON ${INSTALL_PYTHON}
RUN if [ ${INSTALL_PYTHON} = true ]; then \
apt-get update \
&& apt-get -y install python python-pip python-dev build-essential \
&& pip install --upgrade pip \
&& pip install --upgrade virtualenv \
;fi
#####################################
# ImageMagick:
#####################################
USER root
ARG INSTALL_IMAGEMAGICK=false
ENV INSTALL_IMAGEMAGICK ${INSTALL_IMAGEMAGICK}
RUN if [ ${INSTALL_IMAGEMAGICK} = true ]; then \
apt-get install -y --force-yes imagemagick php-imagick \
;fi
# #
#-------------------------------------------------------------------------- #--------------------------------------------------------------------------
# Final Touch # Final Touch

View File

@ -132,7 +132,8 @@ RUN echo "" >> ~/.bashrc && \
ARG INSTALL_XDEBUG=false ARG INSTALL_XDEBUG=false
RUN if [ ${INSTALL_XDEBUG} = true ]; then \ RUN if [ ${INSTALL_XDEBUG} = true ]; then \
# Load the xdebug extension only with phpunit commands # Load the xdebug extension only with phpunit commands
apt-get install -y --force-yes php-xdebug && \ apt-get update && \
apt-get install -y --force-yes php7.1-xdebug && \
sed -i 's/^;//g' /etc/php/7.1/cli/conf.d/20-xdebug.ini && \ sed -i 's/^;//g' /etc/php/7.1/cli/conf.d/20-xdebug.ini && \
echo "alias phpunit='php -dzend_extension=xdebug.so /var/www/vendor/bin/phpunit'" >> ~/.bashrc \ echo "alias phpunit='php -dzend_extension=xdebug.so /var/www/vendor/bin/phpunit'" >> ~/.bashrc \
;fi ;fi
@ -185,11 +186,24 @@ ARG INSTALL_MONGO=false
ENV INSTALL_MONGO ${INSTALL_MONGO} ENV INSTALL_MONGO ${INSTALL_MONGO}
RUN if [ ${INSTALL_MONGO} = true ]; then \ RUN if [ ${INSTALL_MONGO} = true ]; then \
# Install the mongodb extension # Install the mongodb extension
pecl install mongodb && \ pecl -q install mongodb && \
echo "extension=mongodb.so" >> /etc/php/7.1/mods-available/mongodb.ini && \ echo "extension=mongodb.so" >> /etc/php/7.1/mods-available/mongodb.ini && \
ln -s /etc/php/7.1/mods-available/mongodb.ini /etc/php/7.1/cli/conf.d/30-mongodb.ini \ ln -s /etc/php/7.1/mods-available/mongodb.ini /etc/php/7.1/cli/conf.d/30-mongodb.ini \
;fi ;fi
#####################################
# PHP REDIS EXTENSION FOR PHP 7.1
#####################################
ARG INSTALL_PHPREDIS=false
ENV INSTALL_PHPREDIS ${INSTALL_PHPREDIS}
RUN if [ ${INSTALL_PHPREDIS} = true ]; then \
# Install Php Redis extension
printf "\n" | pecl -q install -o -f redis && \
echo "extension=redis.so" >> /etc/php/7.1/mods-available/redis.ini && \
phpenmod redis \
;fi
##################################### #####################################
# Drush: # Drush:
##################################### #####################################
@ -198,12 +212,28 @@ ENV DRUSH_VERSION 8.1.2
ARG INSTALL_DRUSH=false ARG INSTALL_DRUSH=false
ENV INSTALL_DRUSH ${INSTALL_DRUSH} ENV INSTALL_DRUSH ${INSTALL_DRUSH}
RUN if [ ${INSTALL_DRUSH} = true ]; then \ RUN if [ ${INSTALL_DRUSH} = true ]; then \
apt-get update -yqq && \
apt-get -y install mysql-client && \
# Install Drush 8 with the phar file. # Install Drush 8 with the phar file.
curl -fsSL -o /usr/local/bin/drush https://github.com/drush-ops/drush/releases/download/$DRUSH_VERSION/drush.phar | bash && \ curl -fsSL -o /usr/local/bin/drush https://github.com/drush-ops/drush/releases/download/$DRUSH_VERSION/drush.phar | bash && \
chmod +x /usr/local/bin/drush && \ chmod +x /usr/local/bin/drush && \
drush core-status \ drush core-status \
;fi ;fi
#####################################
# Drupal Console:
#####################################
USER root
ARG INSTALL_DRUPAL_CONSOLE=false
ENV INSTALL_DRUPAL_CONSOLE ${INSTALL_DRUPAL_CONSOLE}
RUN if [ ${INSTALL_DRUPAL_CONSOLE} = true ]; then \
apt-get update -yqq && \
apt-get -y install mysql-client && \
curl https://drupalconsole.com/installer -L -o drupal.phar && \
mv drupal.phar /usr/local/bin/drupal && \
chmod +x /usr/local/bin/drupal \
;fi
USER laradock USER laradock
##################################### #####################################
@ -243,6 +273,10 @@ RUN if [ ${INSTALL_NODE} = true ]; then \
echo '[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm' >> ~/.bashrc \ echo '[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm' >> ~/.bashrc \
;fi ;fi
# Add PATH for node
ENV PATH $PATH:$NVM_DIR/versions/node/v${NODE_VERSION}/bin
##################################### #####################################
# YARN: # YARN:
##################################### #####################################
@ -334,14 +368,6 @@ USER laradock
RUN echo "" >> ~/.bashrc && \ RUN echo "" >> ~/.bashrc && \
echo 'export PATH="/var/www/vendor/bin:$PATH"' >> ~/.bashrc echo 'export PATH="/var/www/vendor/bin:$PATH"' >> ~/.bashrc
#####################################
# Laravel Artisan Alias
#####################################
USER root
RUN echo "" >> ~/.bashrc && \
echo 'alias art="php artisan"' >> ~/.bashrc
##################################### #####################################
# Laravel Envoy: # Laravel Envoy:
##################################### #####################################
@ -510,6 +536,21 @@ RUN if [ ${INSTALL_MC} = true ]; then\
chmod +x /usr/local/bin/mc \ chmod +x /usr/local/bin/mc \
;fi ;fi
#####################################
# Image optimizers:
#####################################
USER root
ARG INSTALL_IMAGE_OPTIMIZERS=false
ENV INSTALL_IMAGE_OPTIMIZERS ${INSTALL_IMAGE_OPTIMIZERS}
RUN if [ ${INSTALL_IMAGE_OPTIMIZERS} = true ]; then \
apt-get install -y --force-yes jpegoptim optipng pngquant gifsicle && \
if [ ${INSTALL_NODE} = true ]; then \
. ~/.bashrc && npm install -g svgo \
;fi\
;fi
USER laradock
##################################### #####################################
# Symfony: # Symfony:
##################################### #####################################
@ -532,7 +573,28 @@ RUN if [ ${INSTALL_SYMFONY} = true ]; then \
;fi ;fi
USER laradock #####################################
# PYTHON:
#####################################
ARG INSTALL_PYTHON=false
ENV INSTALL_PYTHON ${INSTALL_PYTHON}
RUN if [ ${INSTALL_PYTHON} = true ]; then \
apt-get update \
&& apt-get -y install python python-pip python-dev build-essential \
&& pip install --upgrade pip \
&& pip install --upgrade virtualenv \
;fi
#####################################
# ImageMagick:
#####################################
USER root
ARG INSTALL_IMAGEMAGICK=false
ENV INSTALL_IMAGEMAGICK ${INSTALL_IMAGEMAGICK}
RUN if [ ${INSTALL_IMAGEMAGICK} = true ]; then \
apt-get install -y --force-yes imagemagick php-imagick \
;fi
# #
#-------------------------------------------------------------------------- #--------------------------------------------------------------------------

View File

@ -10,23 +10,54 @@ COL_BLUE=$ESC_SEQ"34;01m"
COL_MAGENTA=$ESC_SEQ"35;01m" COL_MAGENTA=$ESC_SEQ"35;01m"
COL_CYAN=$ESC_SEQ"36;01m" COL_CYAN=$ESC_SEQ"36;01m"
# Detect which `ls` flavor is in use
if ls --color > /dev/null 2>&1; then # GNU `ls`
colorflag="--color"
export LS_COLORS='no=00:fi=00:di=01;31:ln=01;36:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.gz=01;31:*.bz2=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.avi=01;35:*.fli=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.ogg=01;35:*.mp3=01;35:*.wav=01;35:'
else # macOS `ls`
colorflag="-G"
export LSCOLORS='BxBxhxDxfxhxhxhxhxcxcx'
fi
# List all files colorized in long format
#alias l="ls -lF ${colorflag}"
### MEGA: I want l and la ti return hisdden files
alias l="ls -laF ${colorflag}"
# List all files colorized in long format, including dot files
alias la="ls -laF ${colorflag}"
# List only directories
alias lsd="ls -lF ${colorflag} | grep --color=never '^d'"
# Always use color output for `ls`
alias ls="command ls ${colorflag}"
# Commonly Used Aliases # Commonly Used Aliases
alias ..="cd .." alias ..="cd .."
alias ...="cd ../.."
alias ....="cd ../../.."
alias .....="cd ../../../.."
alias ~="cd ~" # `cd` is probably faster to type though
alias -- -="cd -"
alias home="cd ~"
alias h="history"
alias j="jobs"
alias e='exit'
alias c="clear" alias c="clear"
alias cla="clear && ls -l" alias cla="clear && ls -l"
alias cll="clear && ls -la" alias cll="clear && ls -la"
alias cls="clear && ls" alias cls="clear && ls"
alias code="cd /var/www" alias code="cd /var/www"
alias ea="vi ~/aliases" alias ea="vi ~/aliases"
alias g="gulp"
alias home="cd ~"
alias npm-global="npm list -g --depth 0"
alias ra="reload"
alias reload="source ~/.aliases && echo \"$COL_GREEN ==> Aliases Reloaded... $COL_RESET \n \""
alias run="npm run"
alias tree="xtree"
# Laravel / PHP Alisases # Always enable colored `grep` output
# Note: `GREP_OPTIONS="--color=auto"` is deprecated, hence the alias usage.
alias grep='grep --color=auto'
alias fgrep='fgrep --color=auto'
alias egrep='egrep --color=auto'
alias art="php artisan" alias art="php artisan"
alias artisan="php artisan" alias artisan="php artisan"
alias cdump="composer dump-autoload -o" alias cdump="composer dump-autoload -o"
@ -34,18 +65,31 @@ alias composer:dump="composer dump-autoload -o"
alias db:reset="php artisan migrate:reset && php artisan migrate --seed" alias db:reset="php artisan migrate:reset && php artisan migrate --seed"
alias migrate="php artisan migrate" alias migrate="php artisan migrate"
alias seed="php artisan:seed" alias seed="php artisan:seed"
alias phpunit="./vendor/bin/phpunit"
alias phpunit="./vendor/bin/phpunit"
alias pu="phpunit"
alias puf="phpunit --filter"
alias pud='phpunit --debug'
alias cc='codecept'
alias ccb='codecept build'
alias ccr='codecept run'
alias ccu='codecept run unit'
alias ccf='codecept run functional'
alias g="gulp"
alias npm-global="npm list -g --depth 0"
alias ra="reload"
alias reload="source ~/.aliases && echo \"$COL_GREEN ==> Aliases Reloaded... $COL_RESET \n \""
alias run="npm run"
alias tree="xtree"
# requires installation of 'https://www.npmjs.com/package/npms-cli' # requires installation of 'https://www.npmjs.com/package/npms-cli'
alias npms="npms search" alias npms="npms search"
# requires installation of 'https://www.npmjs.com/package/package-menu-cli' # requires installation of 'https://www.npmjs.com/package/package-menu-cli'
alias pm="package-menu" alias pm="package-menu"
# requires installation of 'https://www.npmjs.com/package/pkg-version-cli' # requires installation of 'https://www.npmjs.com/package/pkg-version-cli'
alias pv="package-version" alias pv="package-version"
# requires installation of 'https://github.com/sindresorhus/latest-version-cli' # requires installation of 'https://github.com/sindresorhus/latest-version-cli'
alias lv="latest-version" alias lv="latest-version"
@ -56,7 +100,6 @@ alias git-revert="git reset --hard && git clean -df"
alias gs="git status" alias gs="git status"
alias whoops="git reset --hard && git clean -df" alias whoops="git reset --hard && git clean -df"
# Create a new directory and enter it # Create a new directory and enter it
function mkd() { function mkd() {
mkdir -p "$@" && cd "$@" mkdir -p "$@" && cd "$@"
@ -69,3 +112,25 @@ function md() {
function xtree { function xtree {
find ${1:-.} -print | sed -e 's;[^/]*/;|____;g;s;____|; |;g' find ${1:-.} -print | sed -e 's;[^/]*/;|____;g;s;____|; |;g'
} }
# `tre` is a shorthand for `tree` with hidden files and color enabled, ignoring
# the `.git` directory, listing directories first. The output gets piped into
# `less` with options to preserve color and line numbers, unless the output is
# small enough for one screen.
function tre() {
tree -aC -I '.git|node_modules|bower_components' --dirsfirst "$@" | less -FRNX;
}
# Determine size of a file or total size of a directory
function fs() {
if du -b /dev/null > /dev/null 2>&1; then
local arg=-sbh;
else
local arg=-sh;
fi
if [[ -n "$@" ]]; then
du $arg -- "$@";
else
du $arg .[^.]* ./*;
fi;
}