diff --git a/.gitignore b/.gitignore index e215d35..45d4e72 100644 --- a/.gitignore +++ b/.gitignore @@ -17,4 +17,6 @@ !/.devcontainer/devcontainer.example.json !/.devcontainer/docker-compose.extend-example.yml +docker-compose.custom.yml + .DS_Store diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml deleted file mode 100644 index 41f37b9..0000000 --- a/.gitlab-ci.yml +++ /dev/null @@ -1,62 +0,0 @@ -# image: docker:latest -# services: -# - docker:dind -image: jonaskello/docker-and-compose:1.12.1-1.8.0 -services: - - docker:1.12.1-dind - -before_script: - - docker info - - docker-compose version - - cp env-example .env - - sed -i -- "s/=false/=true/g" .env - - cat .env - - env | sort - -build:5.6:php-fpm: - variables: - PHP_VERSION: "5.6" - script: - - docker-compose build php-fpm - -build:7.0:php-fpm: - variables: - PHP_VERSION: "7.0" - script: - - docker-compose build php-fpm - -build:7.1:php-fpm: - variables: - PHP_VERSION: "7.1" - script: - - docker-compose build php-fpm - -build:7.2:php-fpm: - variables: - PHP_VERSION: "7.2" - script: - - docker-compose build php-fpm - -build:5.6:workspace: - variables: - PHP_VERSION: "5.6" - script: - - docker-compose build workspace - -build:7.0:workspace: - variables: - PHP_VERSION: "7.0" - script: - - docker-compose build workspace - -build:7.1:workspace: - variables: - PHP_VERSION: "7.1" - script: - - docker-compose build workspace - -build:7.2:workspace: - variables: - PHP_VERSION: "7.2" - script: - - docker-compose build workspace diff --git a/.vscode/settings.json b/.vscode/settings.json index 6d8e9ee..1166680 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,5 +1,6 @@ { "files.associations": { + "env-example": "dotenv", "Dockerfile-*": "dockerfile" - }, + } } diff --git a/DOCUMENTATION/content/contributing/index.md b/DOCUMENTATION/content/contributing/index.md index 0b01941..3dea7fe 100644 --- a/DOCUMENTATION/content/contributing/index.md +++ b/DOCUMENTATION/content/contributing/index.md @@ -108,7 +108,7 @@ To update the sidebar or add a new section to it, you can edit this `DOCUMENTATI * Search for the image in the [Docker Hub](https://hub.docker.com/search/) and find the source.. -*Most of the image in Laradock are offical images, these projects live in other repositories and maintainer by other organizations.* +*Most of the image in Laradock are official images, these projects live in other repositories and maintainer by other organizations.* **Note:** Laradock has two base images for (`Workspace` and `php-fpm`, mainly made to speed up the build time on your machine. diff --git a/DOCUMENTATION/content/documentation/index.md b/DOCUMENTATION/content/documentation/index.md index 5eae9a0..89e5da3 100644 --- a/DOCUMENTATION/content/documentation/index.md +++ b/DOCUMENTATION/content/documentation/index.md @@ -61,7 +61,7 @@ docker-compose down > Run commands in a running Container. -1 - First list the current running containers with `docker ps` +1 - First list the currently running containers with `docker ps` 2 - Enter any container using: @@ -220,9 +220,9 @@ The PHP-CLI extensions should be installed in `workspace/Dockerfile`.
## Change the (PHP-FPM) Version -By default the latest stable PHP versin is configured to run. +By default the latest stable PHP version is configured to run. ->The PHP-FPM is responsible of serving your application code, you don't have to change the PHP-CLI version if you are planning to run your application on different PHP-FPM version. +>The PHP-FPM is responsible for serving your application code, you don't have to change the PHP-CLI version if you are planning to run your application on different PHP-FPM version. ### A) Switch from PHP `7.2` to PHP `5.6` @@ -256,7 +256,7 @@ docker-compose build php-fpm >Note: it's not very essential to edit the PHP-CLI version. The PHP-CLI is only used for the Artisan Commands & Composer. It doesn't serve your Application code, this is the PHP-FPM job. -The PHP-CLI is installed in the Workspace container. To change the PHP-CLI version you need to simply change the `PHP_VERSION` in te .env file as follow: +The PHP-CLI is installed in the Workspace container. To change the PHP-CLI version you need to simply change the `PHP_VERSION` in the .env file as follow: 1 - Open the `.env`. @@ -309,7 +309,7 @@ To control the behavior of xDebug (in the `php-fpm` Container), you can run the - Start xDebug by default: `.php-fpm/xdebug start`. - See the status: `.php-fpm/xdebug status`. -Note: If `.php-fpm/xdebug` doesn't execute and gives `Permission Denied` error the problem can be that file `xdebug` doesn't have execution access. This can be fixed by running `chmod` command with desired access permissions. +Note: If `.php-fpm/xdebug` doesn't execute and gives `Permission Denied` error the problem can be that file `xdebug` doesn't have execution access. This can be fixed by running `chmod` command with desired access permissions. @@ -400,7 +400,7 @@ Always download the latest version of [Loaders for ionCube ](http://www.ioncube. 4 - Re-build the containers `docker-compose build workspace` -[**Deployer Documentation Here**](https://deployer.org/docs) +[**Deployer Documentation Here**](https://deployer.org/docs/getting-started.html) @@ -509,7 +509,7 @@ Since the new Laravel application is in the `my-cool-app` folder, we need to rep ```dotenv APP_CODE_PATH_HOST=../my-cool-app/ ``` -4 - Go to that folder and start working.. +4 - Go to that folder and start working. ```bash cd my-cool-app @@ -624,6 +624,7 @@ docker-compose up -d php-worker > Using Use Browsersync with Laravel Mix. 1. Add the following settings to your `webpack.mix.js` file. Please refer to Browsersync [Options](https://browsersync.io/docs/options) page for more options. + ``` const mix = require('laravel-mix') @@ -819,7 +820,7 @@ Read the [Laravel official documentation](https://laravel.com/docs/5.7/redis#con ## Use Varnish -The goal was to proxy request to varnish server using nginx. So only nginx has been configured for Varnish proxy. +The goal was to proxy the request to varnish server using nginx. So only nginx has been configured for Varnish proxy. Nginx is on port 80 or 443. Nginx sends request through varnish server and varnish server sends request back to nginx on port 81 (external port is defined in `VARNISH_BACKEND_PORT`). The idea was taken from this [post](https://www.linode.com/docs/websites/varnish/use-varnish-and-nginx-to-serve-wordpress-over-ssl-and-http-on-debian-8/) @@ -952,7 +953,7 @@ More details about this [here](https://github.com/jenssegers/laravel-mongodb#ins 7 - Test it: -- First let your Models extend from the Mongo Eloquent Model. Check the [documentation](https://github.com/jenssegers/laravel-mongodb#eloquent). +- First, let your Models extend from the Mongo Eloquent Model. Check the [documentation](https://github.com/jenssegers/laravel-mongodb#eloquent). - Enter the Workspace Container. - Migrate the Database `php artisan migrate`. @@ -977,7 +978,7 @@ docker-compose up -d mariadb phpmyadmin *Note: To use with MariaDB, open `.env` and set `PMA_DB_ENGINE=mysql` to `PMA_DB_ENGINE=mariadb`.* -2 - Open your browser and visit the localhost on port **8080**: `http://localhost:8080` +2 - Open your browser and visit the localhost on port **8081**: `http://localhost:8081` @@ -1057,7 +1058,7 @@ job1: 7 - Push changes to gitlab -8 - Verify that pipeline is run successful +8 - Verify that pipeline is running successfully @@ -1074,7 +1075,7 @@ job1: 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 **8081**: `http://localhost:8081` **Note:** We've locked Adminer to version 4.3.0 as at the time of writing [it contained a major bug](https://sourceforge.net/p/adminer/bugs-and-features/548/) preventing PostgreSQL users from logging in. If that bug is fixed (or if you're not using PostgreSQL) feel free to set Adminer to the latest version within [the Dockerfile](https://github.com/laradock/laradock/blob/master/adminer/Dockerfile#L1): `FROM adminer:latest` @@ -1211,7 +1212,7 @@ docker-compose up -d elasticsearch ```bash docker-compose exec elasticsearch /usr/share/elasticsearch/bin/plugin install {plugin-name} ``` -For ElasticSearch 5.0 and above, the previous "plugin" command as been renamed to "elasticsearch-plguin". +For ElasticSearch 5.0 and above, the previous "plugin" command has been renamed to "elasticsearch-plguin". Use the following instead: ```bash @@ -1225,7 +1226,19 @@ docker-compose restart elasticsearch ``` +
+ +## Use MeiliSearch +1 - Run the MeiliSearch Container (`meilisearch`) with the `docker-compose up` command. Example: + +```bash +docker-compose up -d meilisearch +``` + +2 - Open your browser and visit the localhost on port **7700** at the following URL: `http://localhost:7700` + +> The private API key is `masterkey` @@ -1353,7 +1366,7 @@ For more documentation on Thumbor visit the [Thumbor documenation](http://thumbo ## Use AWS 1 - Configure AWS: - - make sure to add your SSH keys in aws/ssh_keys folder + - make sure to add your SSH keys in aws-eb-cli/ssh_keys folder 2 - Run the Aws Container (`aws`) with the `docker-compose up` command. Example: @@ -1425,30 +1438,13 @@ GRAYLOG_SHA256_PASSWORD=b1cb6e31e172577918c9e7806c572b5ed8477d3f57aa737bee4b5b1d ## Use Traefik -To use Traefik you need to do some changes in `traefik/trafik.toml` and `docker-compose.yml`. +To use Traefik you need to do some changes in `.env` and `docker-compose.yml`. -1 - Open `traefik.toml` and change the `e-mail` property in `acme` section. +1 - Open `.env` and change `ACME_DOMAIN` to your domain and `ACME_EMAIL` to your email. -2 - Change your domain in `acme.domains`. For example: `main = "example.org"` +2 - You need to change the `docker-compose.yml` file to match the Traefik needs. If you want to use Traefik, you must not expose the ports of each container to the internet, but specify some labels. -2.1 - If you have subdomains, you must add them to `sans` property in `acme.domains` section. - -```bash -[[acme.domais]] - main = "example.org" - sans = ["monitor.example.org", "pma.example.org"] -``` - -3 - If you need to add basic authentication (https://docs.traefik.io/configuration/entrypoints/#basic-authentication), you just need to add the following text after `[entryPoints.https.tls]`: - -```bash -[entryPoints.https.auth.basic] - users = ["user:password"] -``` - -4 - You need to change the `docker-compose.yml` file to match the Traefik needs. If you want to use Traefik, you must not expose the ports of each container to the internet, but specify some labels. - -4.1 For example, let's try with NGINX. You must have: +2.1 For example, let's try with NGINX. You must have: ```bash nginx: @@ -1468,9 +1464,25 @@ nginx: - frontend - backend labels: - - traefik.backend=nginx - - traefik.frontend.rule=Host:example.org - - traefik.port=80 + - "traefik.enable=true" + - "traefik.http.services.nginx.loadbalancer.server.port=80" + # https router + - "traefik.http.routers.https.rule=Host(`${ACME_DOMAIN}`, `www.${ACME_DOMAIN}`)" + - "traefik.http.routers.https.entrypoints=https" + - "traefik.http.routers.https.middlewares=www-redirectregex" + - "traefik.http.routers.https.service=nginx" + - "traefik.http.routers.https.tls.certresolver=letsencrypt" + # http router + - "traefik.http.routers.http.rule=Host(`${ACME_DOMAIN}`, `www.${ACME_DOMAIN}`)" + - "traefik.http.routers.http.entrypoints=http" + - "traefik.http.routers.http.middlewares=http-redirectscheme" + - "traefik.http.routers.http.service=nginx" + # middlewares + - "traefik.http.middlewares.www-redirectregex.redirectregex.permanent=true" + - "traefik.http.middlewares.www-redirectregex.redirectregex.regex=^https://www.(.*)" + - "traefik.http.middlewares.www-redirectregex.redirectregex.replacement=https://$$1" + - "traefik.http.middlewares.http-redirectscheme.redirectscheme.permanent=true" + - "traefik.http.middlewares.http-redirectscheme.redirectscheme.scheme=https" ``` instead of @@ -1870,6 +1882,23 @@ To install NVM and NodeJS in the Workspace container +
+ +## Install PNPM + +pnpm uses hard links and symlinks to save one version of a module only ever once on a disk. When using npm or Yarn for example, if you have 100 projects using the same version of lodash, you will have 100 copies of lodash on disk. With pnpm, lodash will be saved in a single place on the disk and a hard link will put it into the node_modules where it should be installed. + +As a result, you save gigabytes of space on your disk and you have a lot faster installations! If you'd like more details about the unique node_modules structure that pnpm creates and why it works fine with the Node.js ecosystem. +More info here: https://pnpm.js.org/en/motivation + +1 - Open the `.env` file + +2 - Search for the `WORKSPACE_INSTALL_NODE` and `WORKSPACE_INSTALL_PNPM` argument under the Workspace Container and set it to `true` + +3 - Re-build the container `docker-compose build workspace` + + + @@ -1992,7 +2021,7 @@ To install FFMPEG in the Workspace container 4 - If you use the `php-worker` container too, please follow the same steps above especially if you have conversions that have been queued. -**PS** Don't forget to install the binary in the `php-fpm` container too by applying the same steps above to its container, otherwise the you'll get an error when running the `php-ffmpeg` binary. +**PS** Don't forget to install the binary in the `php-fpm` container too by applying the same steps above to its container, otherwise you'll get an error when running the `php-ffmpeg` binary.
@@ -2050,7 +2079,7 @@ To install Supervisor in the Workspace container 3 - Create supervisor configuration file (for ex., named `laravel-worker.conf`) for Laravel Queue Worker in `php-worker/supervisord.d/` by simply copy from `laravel-worker.conf.example` -4 - Re-build the container `docker-compose build workspace` Or `docker-composer up --build -d workspace` +4 - Re-build the container `docker-compose build workspace` Or `docker-compose up --build -d workspace` @@ -2169,6 +2198,32 @@ YAML PHP extension allows you to easily parse and create YAML structured data. I 4 - Re-build the container `docker-compose build php-fpm`
+
+ +## Install RDKAFKA extension in php-fpm + +1 - Open the `.env` file +
+2 - Search for the `PHP_FPM_INSTALL_RDKAFKA` argument under the PHP-FPM container +
+3 - Set it to `true` +
+4 - Re-build the container `docker-compose build php-fpm`
+ + +
+ +## Install RDKAFKA extension in workspace + +This is needed for 'composer install' if your dependencies require Kafka. + +1 - Open the `.env` file +
+2 - Search for the `WORKSPACE_INSTALL_RDKAFKA` argument under the WORKSPACE container +
+3 - Set it to `true` +
+4 - Re-build the container `docker-compose build workspace`

diff --git a/DOCUMENTATION/content/getting-started/index.md b/DOCUMENTATION/content/getting-started/index.md index 47108ab..b96cdfe 100644 --- a/DOCUMENTATION/content/getting-started/index.md +++ b/DOCUMENTATION/content/getting-started/index.md @@ -38,7 +38,7 @@ git submodule add https://github.com/Laradock/laradock.git Note: If you are not using Git yet for your project, you can use `git clone` instead of `git submodule `. -*To keep track of your Laradock changes, between your projects and also keep Laradock updated [check these docs](/documentation/#keep-track-of-your-laradock-changes)* +*To keep track of your Laradock changes, between your projects and also keep Laradock updated [check these docs](/documentation/#track-your-laradock-changes)* 2 - Make sure your folder structure should look like this: diff --git a/DOCUMENTATION/content/help/index.md b/DOCUMENTATION/content/help/index.md index dddb80a..519d129 100644 --- a/DOCUMENTATION/content/help/index.md +++ b/DOCUMENTATION/content/help/index.md @@ -105,7 +105,7 @@ WORKSPACE_COMPOSER_REPO_PACKAGIST=https://packagist.phpcomposer.com ## I got (Module build failed: Error: write EPIPE) while compiling react application -When you run `npm build` or `yarn dev` building a react application using webpack with elixir you may receive a `Error: write EPIPE` while processing .jpg images. +When you run `npm build` or `yarn dev` building a react application using webpack with elixir you may receive an `Error: write EPIPE` while processing .jpg images. This is caused of an outdated library for processing **.jpg files** in ubuntu 16.04. @@ -113,7 +113,7 @@ To fix the problem you can follow those steps 1 - Open the `.env`. -2 - Search for `WORKSPACE_INSTALL_LIBPNG` or add the key if missing. +2 - Search for `WORKSPACE_INSTALL_LIBPNG` or add the key, if missing. 3 - Set the value to true: diff --git a/DOCUMENTATION/content/introduction/index.md b/DOCUMENTATION/content/introduction/index.md index 0251c3a..6479dad 100644 --- a/DOCUMENTATION/content/introduction/index.md +++ b/DOCUMENTATION/content/introduction/index.md @@ -21,7 +21,7 @@ It supports a variety of common services, all pre-configured to provide a ready - Choose your favorite database engine: MySQL, Postgres, MariaDB... - Run your own stack: Memcached, HHVM, RabbitMQ... - Each software runs on its own container: PHP-FPM, NGINX, PHP-CLI... -- Easy to customize any container, with simple edit to the `Dockerfile`. +- Easy to customize any container, with simple edits to the `Dockerfile`. - All Images extends from an official base Image. (Trusted base Images). - Pre-configured NGINX to host any code at your root directory. - Can use Laradock per project, or single Laradock for all projects. @@ -82,7 +82,7 @@ That's it! enjoy :) > You can turn On/Off as many instances as you want without worrying about the configurations. > To run a chosen container from the list below, run `docker-compose up -d {container-name}`. -> The container name `{container-name}` is the same as its folder name. Example to run the "PHP FPM" container use the name "php-fpm". +> The container name `{container-name}` is the same as its folder name. Example to run the "PHP FPM" container, use the name "php-fpm". - **Web Servers:** - NGINX @@ -413,6 +413,36 @@ Contribute and help us sustain the project. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Support Laradock with your [organization](https://opencollective.com/laradock/contribute/).
@@ -473,6 +503,36 @@ For more info contact support@laradock.i + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/README.md b/README.md index 172e437..2007e77 100644 --- a/README.md +++ b/README.md @@ -231,6 +231,37 @@ Contribute and help us sustain the project. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Support Laradock with your [organization](https://opencollective.com/laradock/contribute/).
@@ -290,6 +321,36 @@ For more info contact support@laradock.i + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ## License diff --git a/apache2/Dockerfile b/apache2/Dockerfile index 7f0e657..ec824f4 100644 --- a/apache2/Dockerfile +++ b/apache2/Dockerfile @@ -19,6 +19,19 @@ WORKDIR /var/www/ COPY vhost.conf /etc/apache2/sites-enabled/vhost.conf +ARG APACHE_INSTALL_HTTP2=false +RUN mkdir /etc/apache2/ssl 2> /dev/null +RUN if [ ${APACHE_INSTALL_HTTP2} = true ]; then \ + openssl genrsa -out "/etc/apache2/ssl/ssl_site.key" 2048 \ + && openssl rand -out /root/.rnd -hex 256 \ + && openssl req -new -key "/etc/apache2/ssl/ssl_site.key" -out "/etc/apache2/ssl/ssl_site.csr" -subj "/CN=site.com/O=LGS/C=IT" \ + && openssl x509 -req -days 365 -in "/etc/apache2/ssl/ssl_site.csr" -signkey "/etc/apache2/ssl/ssl_site.key" -out "/etc/apache2/ssl/ssl_site.crt" \ + && a2enmod rewrite \ + && a2enmod headers \ + && a2enmod proxy proxy_html proxy_http xml2enc ssl http2 \ + && service apache2 restart \ +;fi + ENTRYPOINT ["/opt/docker/bin/entrypoint.sh"] CMD ["supervisord"] diff --git a/certbot/Dockerfile b/certbot/Dockerfile index ad95113..3d67cd6 100644 --- a/certbot/Dockerfile +++ b/certbot/Dockerfile @@ -1,4 +1,4 @@ -FROM phusion/baseimage:latest +FROM phusion/baseimage:bionic-1.0.0 LABEL maintainer="Mahmoud Zalt " diff --git a/docker-compose.yml b/docker-compose.yml index 3864bde..efdfef9 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -37,6 +37,8 @@ volumes: driver: ${VOLUMES_DRIVER} caddy: driver: ${VOLUMES_DRIVER} + meilisearch: + driver: ${VOLUMES_DRIVER} elasticsearch: driver: ${VOLUMES_DRIVER} mosquitto: @@ -87,6 +89,7 @@ services: - NVM_NODEJS_ORG_MIRROR=${WORKSPACE_NVM_NODEJS_ORG_MIRROR} - INSTALL_NODE=${WORKSPACE_INSTALL_NODE} - NPM_REGISTRY=${WORKSPACE_NPM_REGISTRY} + - INSTALL_PNPM=${WORKSPACE_INSTALL_PNPM} - INSTALL_YARN=${WORKSPACE_INSTALL_YARN} - INSTALL_NPM_GULP=${WORKSPACE_INSTALL_NPM_GULP} - INSTALL_NPM_BOWER=${WORKSPACE_INSTALL_NPM_BOWER} @@ -110,6 +113,7 @@ services: - INSTALL_MC=${WORKSPACE_INSTALL_MC} - INSTALL_SYMFONY=${WORKSPACE_INSTALL_SYMFONY} - INSTALL_PYTHON=${WORKSPACE_INSTALL_PYTHON} + - INSTALL_PYTHON3=${WORKSPACE_INSTALL_PYTHON3} - INSTALL_IMAGE_OPTIMIZERS=${WORKSPACE_INSTALL_IMAGE_OPTIMIZERS} - INSTALL_IMAGEMAGICK=${WORKSPACE_INSTALL_IMAGEMAGICK} - INSTALL_TERRAFORM=${WORKSPACE_INSTALL_TERRAFORM} @@ -119,6 +123,7 @@ services: - INSTALL_SWOOLE=${WORKSPACE_INSTALL_SWOOLE} - INSTALL_TAINT=${WORKSPACE_INSTALL_TAINT} - INSTALL_LIBPNG=${WORKSPACE_INSTALL_LIBPNG} + - INSTALL_GRAPHVIZ=${WORKSPACE_INSTALL_GRAPHVIZ} - INSTALL_IONCUBE=${WORKSPACE_INSTALL_IONCUBE} - INSTALL_MYSQL_CLIENT=${WORKSPACE_INSTALL_MYSQL_CLIENT} - INSTALL_PING=${WORKSPACE_INSTALL_PING} @@ -127,8 +132,10 @@ services: - INSTALL_FSWATCH=${WORKSPACE_INSTALL_FSWATCH} - INSTALL_AST=${WORKSPACE_INSTALL_AST} - INSTALL_YAML=${WORKSPACE_INSTALL_YAML} + - INSTALL_RDKAFKA=${WORKSPACE_INSTALL_RDKAFKA} - INSTALL_MAILPARSE=${WORKSPACE_INSTALL_MAILPARSE} - INSTALL_GIT_PROMPT=${WORKSPACE_INSTALL_GIT_PROMPT} + - INSTALL_XMLRPC=${WORKSPACE_INSTALL_XMLRPC} - PUID=${WORKSPACE_PUID} - PGID=${WORKSPACE_PGID} - CHROME_DRIVER_VERSION=${WORKSPACE_CHROME_DRIVER_VERSION} @@ -144,6 +151,9 @@ services: - INSTALL_FFMPEG=${WORKSPACE_INSTALL_FFMPEG} - INSTALL_WKHTMLTOPDF=${WORKSPACE_INSTALL_WKHTMLTOPDF} - INSTALL_GNU_PARALLEL=${WORKSPACE_INSTALL_GNU_PARALLEL} + - INSTALL_LNAV=${WORKSPACE_INSTALL_LNAV} + - INSTALL_PROTOC=${WORKSPACE_INSTALL_PROTOC} + - PROTOC_VERSION=${WORKSPACE_PROTOC_VERSION} - http_proxy - https_proxy - no_proxy @@ -159,6 +169,7 @@ services: - "${WORKSPACE_BROWSERSYNC_UI_HOST_PORT}:3001" - "${WORKSPACE_VUE_CLI_SERVE_HOST_PORT}:8080" - "${WORKSPACE_VUE_CLI_UI_HOST_PORT}:8000" + - "${WORKSPACE_ANGULAR_CLI_SERVE_HOST_PORT}:4200" tty: true environment: - PHP_IDE_CONFIG=${PHP_IDE_CONFIG} @@ -234,6 +245,7 @@ services: - INSTALL_FFMPEG=${PHP_FPM_FFMPEG} - INSTALL_WKHTMLTOPDF=${PHP_FPM_INSTALL_WKHTMLTOPDF} - INSTALL_XHPROF=${PHP_FPM_INSTALL_XHPROF} + - INSTALL_XMLRPC=${PHP_FPM_INSTALL_XMLRPC} - PUID=${PHP_FPM_PUID} - PGID=${PHP_FPM_PGID} - LOCALE=${PHP_FPM_DEFAULT_LOCALE} @@ -272,9 +284,11 @@ services: - PHALCON_VERSION=${PHALCON_VERSION} - INSTALL_BZ2=${PHP_WORKER_INSTALL_BZ2} - INSTALL_GD=${PHP_WORKER_INSTALL_GD} + - INSTALL_IMAGEMAGICK=${PHP_WORKER_INSTALL_IMAGEMAGICK} - INSTALL_GMP=${PHP_WORKER_INSTALL_GMP} - INSTALL_PGSQL=${PHP_WORKER_INSTALL_PGSQL} - INSTALL_BCMATH=${PHP_WORKER_INSTALL_BCMATH} + - INSTALL_OCI8=${PHP_WORKER_INSTALL_OCI8} - INSTALL_PHALCON=${PHP_WORKER_INSTALL_PHALCON} - INSTALL_SOAP=${PHP_WORKER_INSTALL_SOAP} - INSTALL_ZIP_ARCHIVE=${PHP_WORKER_INSTALL_ZIP_ARCHIVE} @@ -287,6 +301,8 @@ services: - INSTALL_TAINT=${PHP_WORKER_INSTALL_TAINT} - INSTALL_FFMPEG=${PHP_WORKER_INSTALL_FFMPEG} - INSTALL_REDIS=${PHP_WORKER_INSTALL_REDIS} + - INSTALL_IMAP=${PHP_WORKER_INSTALL_IMAP} + - INSTALL_XMLRPC=${PHP_WORKER_INSTALL_XMLRPC} - PUID=${PHP_WORKER_PUID} - PGID=${PHP_WORKER_PGID} volumes: @@ -308,6 +324,7 @@ services: - INSTALL_BZ2=${LARAVEL_HORIZON_INSTALL_BZ2} - INSTALL_GD=${LARAVEL_HORIZON_INSTALL_GD} - INSTALL_GMP=${LARAVEL_HORIZON_INSTALL_GMP} + - INSTALL_IMAGEMAGICK=${LARAVEL_HORIZON_INSTALL_IMAGEMAGICK} - INSTALL_PGSQL=${PHP_FPM_INSTALL_PGSQL} - INSTALL_ZIP_ARCHIVE=${LARAVEL_HORIZON_INSTALL_ZIP_ARCHIVE} - INSTALL_BCMATH=${PHP_FPM_INSTALL_BCMATH} @@ -376,6 +393,7 @@ services: - PHP_UPSTREAM_PORT=${APACHE_PHP_UPSTREAM_PORT} - PHP_UPSTREAM_TIMEOUT=${APACHE_PHP_UPSTREAM_TIMEOUT} - DOCUMENT_ROOT=${APACHE_DOCUMENT_ROOT} + - APACHE_INSTALL_HTTP2=${APACHE_INSTALL_HTTP2} volumes: - ${APP_CODE_PATH_HOST}:${APP_CODE_PATH_CONTAINER}${APP_CODE_CONTAINER_FLAG} - ${APACHE_HOST_LOG_PATH}:/var/log/apache2 @@ -802,6 +820,17 @@ services: - frontend - backend +### MeiliSearch ########################################## + meilisearch: + image: getmeili/meilisearch:latest + volumes: + - ${DATA_PATH_HOST}/meilisearch:/var/lib/meilisearch + ports: + - "${MEILISEARCH_HOST_PORT}:7700" + networks: + - frontend + - backend + ### ElasticSearch ######################################## elasticsearch: build: @@ -820,6 +849,9 @@ services: memlock: soft: -1 hard: -1 + nofile: + soft: 65536 + hard: 65536 ports: - "${ELASTICSEARCH_HOST_HTTP_PORT}:9200" - "${ELASTICSEARCH_HOST_TRANSPORT_PORT}:9300" @@ -988,38 +1020,40 @@ services: ### Graylog ####################################### graylog: - build: ./graylog - environment: - - GRAYLOG_PASSWORD_SECRET=${GRAYLOG_PASSWORD} - - GRAYLOG_ROOT_PASSWORD_SHA2=${GRAYLOG_SHA256_PASSWORD} - - GRAYLOG_HTTP_EXTERNAL_URI=http://127.0.0.1:${GRAYLOG_PORT}/ - links: - - mongo - - elasticsearch - depends_on: - - mongo - - elasticsearch - ports: - # Graylog web interface and REST API - - ${GRAYLOG_PORT}:9000 - # Syslog TCP - - ${GRAYLOG_SYSLOG_TCP_PORT}:514 - # Syslog UDP - - ${GRAYLOG_SYSLOG_UDP_PORT}:514/udp - # GELF TCP - - ${GRAYLOG_GELF_TCP_PORT}:12201 - # GELF UDP - - ${GRAYLOG_GELF_UDP_PORT}:12201/udp - user: graylog - volumes: - - ${DATA_PATH_HOST}/graylog:/usr/share/graylog/data - networks: - - backend + build: ./graylog + environment: + - GRAYLOG_PASSWORD_SECRET=${GRAYLOG_PASSWORD} + - GRAYLOG_ROOT_PASSWORD_SHA2=${GRAYLOG_SHA256_PASSWORD} + - GRAYLOG_HTTP_EXTERNAL_URI=http://127.0.0.1:${GRAYLOG_PORT}/ + links: + - mongo + - elasticsearch + depends_on: + - mongo + - elasticsearch + ports: + # Graylog web interface and REST API + - ${GRAYLOG_PORT}:9000 + # Syslog TCP + - ${GRAYLOG_SYSLOG_TCP_PORT}:514 + # Syslog UDP + - ${GRAYLOG_SYSLOG_UDP_PORT}:514/udp + # GELF TCP + - ${GRAYLOG_GELF_TCP_PORT}:12201 + # GELF UDP + - ${GRAYLOG_GELF_UDP_PORT}:12201/udp + user: graylog + volumes: + - ${DATA_PATH_HOST}/graylog:/usr/share/graylog/data + networks: + - backend ### Laravel Echo Server ####################################### laravel-echo-server: build: context: ./laravel-echo-server + args: + - CHANGE_SOURCE=${CHANGE_SOURCE} volumes: - ./laravel-echo-server/laravel-echo-server.json:/app/laravel-echo-server.json:ro ports: @@ -1302,11 +1336,13 @@ services: ### NetData ################################################ netdata: - image: titpetric/netdata:latest + image: netdata/netdata:latest cap_add: - - SYS_PTRACE + - SYS_PTRACE volumes: - - /:/host:ro + - /proc:/host/proc:ro + - /sys:/host/sys:ro + - /var/run/docker.sock:/var/run/docker.sock:ro ports: - "${NETDATA_PORT}:19999" networks: @@ -1611,19 +1647,38 @@ services: traefik: build: context: ./traefik - command: --docker volumes: - /var/run/docker.sock:/var/run/docker.sock + - ./traefik/data:/data + command: + - "--api" + - "--providers.docker.exposedbydefault=false" + - "--accesslog.filepath=/data/access.log" + # entrypoints + - "--entrypoints.http.address=:${TRAEFIK_HOST_HTTP_PORT}" + - "--entrypoints.http.http.redirections.entrypoint.to=https" + - "--entrypoints.https.address=:${TRAEFIK_HOST_HTTPS_PORT}" + - "--entrypoints.traefik.address=:${TRAEFIK_DASHBOARD_PORT}" + # certificatesresolvers + - "--certificatesresolvers.letsencrypt.acme.email=${ACME_EMAIL}" + - "--certificatesresolvers.letsencrypt.acme.storage=/data/acme.json" + - "--certificatesresolvers.letsencrypt.acme.httpchallenge.entrypoint=http" ports: - - "${TRAEFIK_HOST_HTTP_PORT}:80" - - "${TRAEFIK_HOST_HTTPS_PORT}:443" + - "${TRAEFIK_HOST_HTTP_PORT}:${TRAEFIK_HOST_HTTP_PORT}" + - "${TRAEFIK_HOST_HTTPS_PORT}:${TRAEFIK_HOST_HTTPS_PORT}" + - "${TRAEFIK_DASHBOARD_PORT}:${TRAEFIK_DASHBOARD_PORT}" networks: - frontend - backend labels: - - traefik.backend=traefik - - traefik.frontend.rule=Host:monitor.localhost - - traefik.port=8080 + - "traefik.enable=true" + - "traefik.http.routers.traefik.rule=Host(`${ACME_DOMAIN}`)" + - "traefik.http.routers.traefik.entrypoints=traefik" + - "traefik.http.routers.traefik.service=api@internal" + - "traefik.http.routers.traefik.middlewares=access-auth" + - "traefik.http.routers.traefik.tls.certresolver=letsencrypt" + - "traefik.http.middlewares.access-auth.basicauth.realm=Login Required" + - "traefik.http.middlewares.access-auth.basicauth.users=${TRAEFIK_DASHBOARD_USER}" ### MOSQUITTO Broker ######################################### mosquitto: diff --git a/env-example b/env-example index ee6eee4..9e44183 100644 --- a/env-example +++ b/env-example @@ -32,7 +32,7 @@ COMPOSE_FILE=docker-compose.yml # Change the separator from : to ; on Windows COMPOSE_PATH_SEPARATOR=: -# Define the prefix of container names. This is useful if you have multiple projects that use laradock to have seperate containers per project. +# Define the prefix of container names. This is useful if you have multiple projects that use laradock to have separate containers per project. COMPOSE_PROJECT_NAME=laradock ### PHP Version ########################################### @@ -44,7 +44,7 @@ PHP_VERSION=7.3 ### Phalcon Version ########################################### # Select a Phalcon version of the Workspace and PHP-FPM containers (Does not apply to HHVM). Accepted values: 3.4.0+ -PHALCON_VERSION=3.4.5 +PHALCON_VERSION=4.0.5 ### PHP Interpreter ####################################### @@ -98,6 +98,7 @@ WORKSPACE_NVM_NODEJS_ORG_MIRROR= WORKSPACE_INSTALL_NODE=true WORKSPACE_NODE_VERSION=node WORKSPACE_NPM_REGISTRY= +WORKSPACE_INSTALL_PNPM=false WORKSPACE_INSTALL_YARN=true WORKSPACE_YARN_VERSION=latest WORKSPACE_INSTALL_NPM_GULP=true @@ -138,6 +139,7 @@ WORKSPACE_INSTALL_LINUXBREW=false WORKSPACE_INSTALL_MC=false WORKSPACE_INSTALL_SYMFONY=false WORKSPACE_INSTALL_PYTHON=false +WORKSPACE_INSTALL_PYTHON3=false WORKSPACE_INSTALL_POWERLINE=false WORKSPACE_INSTALL_SUPERVISOR=false WORKSPACE_INSTALL_IMAGE_OPTIMIZERS=false @@ -149,6 +151,7 @@ WORKSPACE_INSTALL_PHALCON=false WORKSPACE_INSTALL_SWOOLE=false WORKSPACE_INSTALL_TAINT=false WORKSPACE_INSTALL_LIBPNG=false +WORKSPACE_INSTALL_GRAPHVIZ=false WORKSPACE_INSTALL_IONCUBE=false WORKSPACE_INSTALL_MYSQL_CLIENT=false WORKSPACE_INSTALL_PING=false @@ -156,7 +159,9 @@ WORKSPACE_INSTALL_SSHPASS=false WORKSPACE_INSTALL_INOTIFY=false WORKSPACE_INSTALL_FSWATCH=false WORKSPACE_INSTALL_YAML=false +WORKSPACE_INSTALL_RDKAFKA=false WORKSPACE_INSTALL_MAILPARSE=false +WORKSPACE_INSTALL_XMLRPC=false WORKSPACE_PUID=1000 WORKSPACE_PGID=1000 WORKSPACE_CHROME_DRIVER_VERSION=2.42 @@ -171,7 +176,11 @@ WORKSPACE_BROWSERSYNC_HOST_PORT=3000 WORKSPACE_BROWSERSYNC_UI_HOST_PORT=3001 WORKSPACE_VUE_CLI_SERVE_HOST_PORT=8080 WORKSPACE_VUE_CLI_UI_HOST_PORT=8001 +WORKSPACE_ANGULAR_CLI_SERVE_HOST_PORT=4200 WORKSPACE_INSTALL_GIT_PROMPT=false +WORKSPACE_INSTALL_LNAV=false +WORKSPACE_INSTALL_PROTOC=false +WORKSPACE_PROTOC_VERSION=latest ### PHP_FPM ############################################### @@ -217,6 +226,7 @@ PHP_FPM_INSTALL_FAKETIME=false PHP_FPM_INSTALL_IONCUBE=false PHP_FPM_INSTALL_RDKAFKA=false PHP_FPM_INSTALL_GETTEXT=false +PHP_FPM_INSTALL_XMLRPC=false PHP_FPM_FAKETIME=-0 PHP_FPM_INSTALL_APCU=false PHP_FPM_INSTALL_CACHETOOL=false @@ -238,9 +248,12 @@ PHP_FPM_PGID=1000 PHP_WORKER_INSTALL_BZ2=false PHP_WORKER_INSTALL_GD=false +PHP_WORKER_INSTALL_IMAGEMAGICK=false PHP_WORKER_INSTALL_GMP=false PHP_WORKER_INSTALL_PGSQL=false PHP_WORKER_INSTALL_BCMATH=false +# PHP_WORKER_INSTALL_OCI8 Does not work in php5.6 version +PHP_WORKER_INSTALL_OCI8=false PHP_WORKER_INSTALL_PHALCON=false PHP_WORKER_INSTALL_SOAP=false PHP_WORKER_INSTALL_ZIP_ARCHIVE=false @@ -253,6 +266,8 @@ PHP_WORKER_INSTALL_FFMPEG=false PHP_WORKER_INSTALL_CASSANDRA=false PHP_WORKER_INSTALL_GEARMAN=false PHP_WORKER_INSTALL_REDIS=false +PHP_WORKER_INSTALL_IMAP=false +PHP_WORKER_INSTALL_XMLRPC=false PHP_WORKER_PUID=1000 PHP_WORKER_PGID=1000 @@ -272,6 +287,7 @@ NGINX_SSL_PATH=./nginx/ssl/ LARAVEL_HORIZON_INSTALL_BZ2=false LARAVEL_HORIZON_INSTALL_GD=false LARAVEL_HORIZON_INSTALL_GMP=false +LARAVEL_HORIZON_INSTALL_IMAGEMAGICK=false LARAVEL_HORIZON_INSTALL_SOCKETS=false LARAVEL_HORIZON_INSTALL_YAML=false LARAVEL_HORIZON_INSTALL_ZIP_ARCHIVE=false @@ -291,6 +307,7 @@ APACHE_PHP_UPSTREAM_CONTAINER=php-fpm APACHE_PHP_UPSTREAM_PORT=9000 APACHE_PHP_UPSTREAM_TIMEOUT=60 APACHE_DOCUMENT_ROOT=/var/www/ +APACHE_INSTALL_HTTP2=false ### MYSQL ################################################# @@ -356,6 +373,11 @@ RABBITMQ_MANAGEMENT_HTTPS_HOST_PORT=15671 RABBITMQ_DEFAULT_USER=guest RABBITMQ_DEFAULT_PASS=guest +### MEILISEARCH ########################################### + +MEILISEARCH_HOST_PORT=7700 +MEILISEARCH_KEY=masterkey + ### ELASTICSEARCH ######################################### ELASTICSEARCH_HOST_HTTP_PORT=9200 @@ -389,7 +411,7 @@ MINIO_PORT=9000 ### ADMINER ############################################### -ADM_PORT=8080 +ADM_PORT=8081 ADM_INSTALL_MSSQL=false ### PHP MY ADMIN ########################################## @@ -403,7 +425,7 @@ PMA_DB_ENGINE=mysql PMA_USER=default PMA_PASSWORD=secret PMA_ROOT_PASSWORD=secret -PMA_PORT=8080 +PMA_PORT=8081 ### MAILDEV ############################################### @@ -756,6 +778,11 @@ MAILU_WEBDAV=radicale TRAEFIK_HOST_HTTP_PORT=80 TRAEFIK_HOST_HTTPS_PORT=443 +TRAEFIK_DASHBOARD_PORT=8888 +# basic authentication for traefik dashboard username: admin password:admin +TRAEFIK_DASHBOARD_USER=admin:$2y$10$lXaL3lj6raFic6rFqr2.lOBoCudAIhB6zyoqObNg290UFppiUzTTi +ACME_DOMAIN=example.org +ACME_EMAIL=email@example.org ### MOSQUITTO ################################################# @@ -836,8 +863,8 @@ CASSANDRA_RACK=rack1 # Gearman version to use. See available tags at https://hub.docker.com/r/artefactual/gearmand GEARMAN_VERSION=latest -# Port to use (Default: 6379) -GEARMAN_PORT=6379 +# Port to use (Default: 4730) +GEARMAN_PORT=4730 # Logging Level (Default: INFO) GEARMAN_VERBOSE=INFO # Persistent queue type to use (Default: builtin) diff --git a/laravel-echo-server/Dockerfile b/laravel-echo-server/Dockerfile index da6b256..26a64c1 100644 --- a/laravel-echo-server/Dockerfile +++ b/laravel-echo-server/Dockerfile @@ -7,6 +7,14 @@ WORKDIR /usr/src/app # Install app dependencies COPY package.json /usr/src/app/ +# If you're in China, or you need to change sources, will be set CHANGE_SOURCE to true in .env. + +ARG CHANGE_SOURCE=false +RUN if [ ${CHANGE_SOURCE} = true ]; then \ + # Change application source from dl-cdn.alpinelinux.org to aliyun source + sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/' /etc/apk/repositories \ +;fi + RUN apk add --update \ python \ python-dev \ diff --git a/laravel-horizon/Dockerfile b/laravel-horizon/Dockerfile index 4c8f611..d89cb70 100644 --- a/laravel-horizon/Dockerfile +++ b/laravel-horizon/Dockerfile @@ -67,6 +67,16 @@ RUN if [ ${INSTALL_GMP} = true ]; then \ docker-php-ext-install gmp \ ;fi +#Install ImageMagick package: +ARG INSTALL_IMAGEMAGICK=false +RUN set -eux; \ + if [ ${INSTALL_IMAGEMAGICK} = true ]; then \ + apk add --update --no-cache imagemagick-dev; \ + pecl install imagick; \ + docker-php-ext-enable imagick; \ + php -m | grep -q 'imagick'; \ + fi + #Install BCMath package: ARG INSTALL_BCMATH=false RUN if [ ${INSTALL_BCMATH} = true ]; then \ diff --git a/logstash/Dockerfile b/logstash/Dockerfile index 161d381..1a1a753 100644 --- a/logstash/Dockerfile +++ b/logstash/Dockerfile @@ -8,4 +8,5 @@ ADD ./pipeline/ /usr/share/logstash/pipeline/ ADD ./config/ /usr/share/logstash/config/ RUN logstash-plugin install logstash-input-jdbc +RUN logstash-plugin install logstash-input-beats diff --git a/php-fpm/Dockerfile b/php-fpm/Dockerfile index 9d5f895..6d56c01 100644 --- a/php-fpm/Dockerfile +++ b/php-fpm/Dockerfile @@ -28,9 +28,9 @@ ENV DEBIAN_FRONTEND noninteractive ARG CHANGE_SOURCE=false RUN if [ ${CHANGE_SOURCE} = true ]; then \ # Change application source from deb.debian.org to aliyun source - sed -i 's/deb.debian.org/mirrors.tuna.tsinghua.edu.cn/' /etc/apt/sources.list && \ - sed -i 's/security.debian.org/mirrors.tuna.tsinghua.edu.cn/' /etc/apt/sources.list && \ - sed -i 's/security-cdn.debian.org/mirrors.tuna.tsinghua.edu.cn/' /etc/apt/sources.list \ + sed -i 's/deb.debian.org/mirrors.aliyun.com/' /etc/apt/sources.list && \ + sed -i 's/security.debian.org/mirrors.aliyun.com/' /etc/apt/sources.list && \ + sed -i 's/security-cdn.debian.org/mirrors.aliyun.com/' /etc/apt/sources.list \ ;fi # always run apt update when start and after add new source list, then clean up at end. @@ -721,7 +721,14 @@ ENV LARADOCK_PHALCON_VERSION ${LARADOCK_PHALCON_VERSION} COPY ./phalcon.ini /usr/local/etc/php/conf.d/phalcon.ini.disable RUN if [ $INSTALL_PHALCON = true ]; then \ - apt-get update && apt-get install -y unzip libpcre3-dev gcc make re2c \ + apt-get update && apt-get install -y unzip libpcre3-dev gcc make re2c git automake autoconf\ + && git clone https://github.com/jbboehr/php-psr.git \ + && cd php-psr \ + && phpize \ + && ./configure \ + && make \ + && make test \ + && make install \ && curl -L -o /tmp/cphalcon.zip https://github.com/phalcon/cphalcon/archive/v${LARADOCK_PHALCON_VERSION}.zip \ && unzip -d /tmp/ /tmp/cphalcon.zip \ && cd /tmp/cphalcon-${LARADOCK_PHALCON_VERSION}/build \ @@ -865,9 +872,14 @@ RUN if [ ${INSTALL_WKHTMLTOPDF} = true ]; then \ libx11-dev \ libjpeg62 \ libxtst6 \ + fontconfig \ + libjpeg62-turbo \ + xfonts-base \ + xfonts-75dpi \ wget \ - && wget https://github.com/h4cc/wkhtmltopdf-amd64/blob/master/bin/wkhtmltopdf-amd64?raw=true -O /usr/local/bin/wkhtmltopdf \ - && chmod +x /usr/local/bin/wkhtmltopdf \ + && wget https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-1/wkhtmltox_0.12.6-1.stretch_amd64.deb \ + && dpkg -i wkhtmltox_0.12.6-1.stretch_amd64.deb \ + && apt -f install \ ;fi ########################################################################### @@ -899,6 +911,16 @@ RUN if [ ${INSTALL_CACHETOOL} = true ]; then \ mv cachetool.phar /usr/local/bin/cachetool \ ;fi +########################################################################### +# XMLRPC: +########################################################################### + +ARG INSTALL_XMLRPC=false + +RUN if [ ${INSTALL_XMLRPC} = true ]; then \ + docker-php-ext-install xmlrpc \ +;fi + ########################################################################### # Check PHP version: ########################################################################### diff --git a/php-fpm/phalcon.ini b/php-fpm/phalcon.ini index 24b58ba..a501383 100644 --- a/php-fpm/phalcon.ini +++ b/php-fpm/phalcon.ini @@ -1 +1,2 @@ +extension=psr.so extension=phalcon.so \ No newline at end of file diff --git a/php-fpm/xdebug b/php-fpm/xdebug index 8e43202..8adb807 100755 --- a/php-fpm/xdebug +++ b/php-fpm/xdebug @@ -36,7 +36,7 @@ xdebug_start () # And uncomment line with xdebug extension, thus enabling it ON_CMD="sed -i 's/^;zend_extension=/zend_extension=/g' \ - /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini" + /usr/local/etc/php/conf.d/xdebug.ini" # If running on Windows, need to prepend with winpty :( @@ -58,7 +58,7 @@ xdebug_stop () echo 'Stop xDebug' # Comment out xdebug extension line - OFF_CMD="sed -i 's/^zend_extension=/;zend_extension=/g' /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini" + OFF_CMD="sed -i 's/^zend_extension=/;zend_extension=/g' /usr/local/etc/php/conf.d/xdebug.ini" # If running on Windows, need to prepend with winpty :( diff --git a/php-worker/Dockerfile b/php-worker/Dockerfile index 2524dea..f3c8166 100644 --- a/php-worker/Dockerfile +++ b/php-worker/Dockerfile @@ -32,10 +32,16 @@ RUN apk --update add wget \ cyrus-sasl-dev \ libgsasl-dev \ oniguruma-dev \ + openssl \ + openssl-dev \ supervisor RUN docker-php-ext-install mysqli mbstring pdo pdo_mysql tokenizer xml pcntl -RUN pecl channel-update pecl.php.net && pecl install memcached mcrypt-1.0.1 mongodb && docker-php-ext-enable memcached mongodb +RUN if [ $(php -r "echo PHP_MAJOR_VERSION;") = "5" ]; then \ + pecl channel-update pecl.php.net && pecl install memcached-2.2.0 mcrypt-1.0.1 mongodb && docker-php-ext-enable memcached mongodb \ +;else \ + pecl channel-update pecl.php.net && pecl install memcached mcrypt-1.0.1 mongodb && docker-php-ext-enable memcached mongodb \ +;fi # Add a non-root user: ARG PUID=1000 @@ -60,6 +66,14 @@ RUN if [ ${INSTALL_GD} = true ]; then \ docker-php-ext-install gd \ ;fi +#Install ImageMagick: +ARG INSTALL_IMAGEMAGICK=false +RUN if [ ${INSTALL_IMAGEMAGICK} = true ]; then \ + apk add --update imagemagick-dev imagemagick; \ + pecl install imagick; \ + docker-php-ext-enable imagick \ +;fi + #Install GMP package: ARG INSTALL_GMP=false RUN if [ ${INSTALL_GMP} = true ]; then \ @@ -79,6 +93,47 @@ RUN if [ ${INSTALL_BCMATH} = true ]; then \ docker-php-ext-install bcmath \ ;fi +########################################################################### +# PHP OCI8: +########################################################################### + +ARG INSTALL_OCI8=false + +ENV LD_LIBRARY_PATH="/usr/local/instantclient" +ENV ORACLE_HOME="/usr/local/instantclient" + +RUN if [ ${INSTALL_OCI8} = true ] && [ $(php -r "echo PHP_MAJOR_VERSION;") = "7" ]; then \ + apk add make php7-pear php7-dev gcc musl-dev libnsl libaio poppler-utils libzip-dev zip unzip libaio-dev freetds-dev && \ + ## Download and unarchive Instant Client v11 + curl -o /tmp/basic.zip https://raw.githubusercontent.com/bumpx/oracle-instantclient/master/instantclient-basic-linux.x64-11.2.0.4.0.zip && \ + curl -o /tmp/sdk.zip https://raw.githubusercontent.com/bumpx/oracle-instantclient/master/instantclient-sdk-linux.x64-11.2.0.4.0.zip && \ + curl -o /tmp/sqlplus.zip https://raw.githubusercontent.com/bumpx/oracle-instantclient/master/instantclient-sqlplus-linux.x64-11.2.0.4.0.zip && \ + unzip -d /usr/local/ /tmp/basic.zip && \ + unzip -d /usr/local/ /tmp/sdk.zip && \ + unzip -d /usr/local/ /tmp/sqlplus.zip \ + ## Links are required for older SDKs + && ln -s /usr/local/instantclient_11_2 ${ORACLE_HOME} && \ + ln -s ${ORACLE_HOME}/libclntsh.so.* ${ORACLE_HOME}/libclntsh.so && \ + ln -s ${ORACLE_HOME}/libocci.so.* ${ORACLE_HOME}/libocci.so && \ + ln -s ${ORACLE_HOME}/lib* /usr/lib && \ + ln -s ${ORACLE_HOME}/sqlplus /usr/bin/sqlplus &&\ + ln -s /usr/lib/libnsl.so.2.0.0 /usr/lib/libnsl.so.1 && \ + ## Build OCI8 with PECL + echo "instantclient,${ORACLE_HOME}" | pecl install oci8 && \ + echo 'extension=oci8.so' > /etc/php7/conf.d/30-oci8.ini \ + # Clean up + apk del php7-pear php7-dev gcc musl-dev && \ + rm -rf /tmp/*.zip /tmp/pear/ && \ + docker-php-ext-configure pdo_oci --with-pdo-oci=instantclient,/usr/local/instantclient \ + && docker-php-ext-configure pdo_dblib --with-libdir=/lib \ + && docker-php-ext-install pdo_oci \ + && docker-php-ext-enable oci8 \ + && docker-php-ext-install zip && \ + # Install the zip extension + docker-php-ext-configure zip && \ + php -m | grep -q 'zip' \ +;fi + # Install PostgreSQL drivers: ARG INSTALL_PGSQL=false RUN if [ ${INSTALL_PGSQL} = true ]; then \ @@ -160,6 +215,13 @@ ENV PHALCON_VERSION ${PHALCON_VERSION} RUN if [ $INSTALL_PHALCON = true ]; then \ apk --update add unzip gcc make re2c bash\ + && git clone https://github.com/jbboehr/php-psr.git \ + && cd php-psr \ + && phpize \ + && ./configure \ + && make \ + && make test \ + && make install \ && curl -L -o /tmp/cphalcon.zip https://github.com/phalcon/cphalcon/archive/v${PHALCON_VERSION}.zip \ && unzip -d /tmp/ /tmp/cphalcon.zip \ && cd /tmp/cphalcon-${PHALCON_VERSION}/build \ @@ -215,6 +277,28 @@ RUN if [ ${INSTALL_TAINT} = true ]; then \ docker-php-ext-enable taint \ ;fi +########################################################################### +# Imap EXTENSION +########################################################################### + +ARG INSTALL_IMAP=false + +RUN if [ ${INSTALL_IMAP} = true ]; then \ + apk add --update imap-dev openssl-dev && \ + docker-php-ext-configure imap --with-imap --with-imap-ssl && \ + docker-php-ext-install imap \ +;fi + +########################################################################### +# XMLRPC: +########################################################################### + +ARG INSTALL_XMLRPC=false + +RUN if [ ${INSTALL_XMLRPC} = true ]; then \ + docker-php-ext-install xmlrpc \ +;fi + # #-------------------------------------------------------------------------- # Optional Supervisord Configuration diff --git a/traefik/Dockerfile b/traefik/Dockerfile index 73825fd..fa4e176 100644 --- a/traefik/Dockerfile +++ b/traefik/Dockerfile @@ -1,7 +1,11 @@ -FROM traefik:1.7.5-alpine +FROM traefik:v2.2 LABEL maintainer="Luis Coutinho " -COPY traefik.toml acme.json / +WORKDIR /data -RUN chmod 600 /acme.json +RUN touch acme.json + +RUN chmod 600 acme.json + +VOLUME /data \ No newline at end of file diff --git a/traefik/acme.json b/traefik/acme.json deleted file mode 100644 index e69de29..0000000 diff --git a/traefik/data/.gitignore b/traefik/data/.gitignore new file mode 100644 index 0000000..c96a04f --- /dev/null +++ b/traefik/data/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore \ No newline at end of file diff --git a/traefik/traefik.toml b/traefik/traefik.toml deleted file mode 100644 index 5875b94..0000000 --- a/traefik/traefik.toml +++ /dev/null @@ -1,23 +0,0 @@ -defaultEntryPoints = ["http", "https"] - -[entryPoints] - [entryPoints.http] - address = ":80" - [entryPoints.http.redirect] - entryPoint = "https" - [entryPoints.https] - address = ":443" - [entryPoints.https.tls] - -[web] -address = ":8080" -[acme] -email = "email@example.org" -storage = "acme.json" -entryPoint = "https" -onHostRule = true - [acme.httpChallenge] - entryPoint = "http" - -[[acme.domais]] - main = "localhost" diff --git a/workspace/Dockerfile b/workspace/Dockerfile index 4a105bb..c0279b0 100644 --- a/workspace/Dockerfile +++ b/workspace/Dockerfile @@ -75,7 +75,7 @@ RUN set -xe; \ # to add more Software's or remove existing one, you need to edit the # base image (https://github.com/Laradock/workspace). # - # next lines are here becase there is no auto build on dockerhub see https://github.com/laradock/laradock/pull/1903#issuecomment-463142846 + # next lines are here because there is no auto build on dockerhub see https://github.com/laradock/laradock/pull/1903#issuecomment-463142846 libzip-dev zip unzip \ # Install the zip extension php${LARADOCK_PHP_VERSION}-zip \ @@ -610,6 +610,17 @@ RUN if [ ${INSTALL_FSWATCH} = true ]; then \ ;fi ########################################################################### + +# GraphViz extension +########################################################################### + +ARG INSTALL_GRAPHVIZ=false + +RUN if [ ${INSTALL_GRAPHVIZ} = true ]; then \ + apt-get update && \ + apt-get install -y graphviz \ +;fi + # IonCube Loader ########################################################################### @@ -723,6 +734,20 @@ RUN if [ ${NPM_REGISTRY} ]; then \ . ~/.bashrc && npm config set registry ${NPM_REGISTRY} \ ;fi + +########################################################################### +# PNPM: +########################################################################### + +USER laradock + +ARG INSTALL_PNPM=false + +RUN if [ ${INSTALL_PNPM} = true ]; then \ + npx pnpm add -g pnpm \ +;fi + + ########################################################################### # YARN: ########################################################################### @@ -871,7 +896,7 @@ ARG INSTALL_LARAVEL_ENVOY=false RUN if [ ${INSTALL_LARAVEL_ENVOY} = true ]; then \ # Install the Laravel Envoy - composer global require "laravel/envoy=~1.0" \ + composer global require "laravel/envoy=~2.0" \ ;fi ########################################################################### @@ -978,8 +1003,10 @@ RUN set -eux; \ ln -sfn /opt/mssql-tools/bin/bcp /usr/bin/bcp && \ echo "en_US.UTF-8 UTF-8" > /etc/locale.gen && \ locale-gen && \ - if [ $(php -r "echo PHP_MINOR_VERSION;") = "0" ]; then \ + if [ $(php -r "echo PHP_VERSION_ID - PHP_RELEASE_VERSION;") = "70000" ]; then \ pecl install sqlsrv-5.3.0 pdo_sqlsrv-5.3.0 \ + ;elif [ $(php -r "echo PHP_VERSION_ID - PHP_RELEASE_VERSION;") = "70100" ]; then \ + pecl install sqlsrv-5.6.1 pdo_sqlsrv-5.6.1 \ ;else \ pecl install sqlsrv pdo_sqlsrv \ ;fi && \ @@ -1043,7 +1070,7 @@ RUN if [ ${INSTALL_SYMFONY} = true ]; then \ ;fi ########################################################################### -# PYTHON: +# PYTHON2: ########################################################################### ARG INSTALL_PYTHON=false @@ -1054,6 +1081,18 @@ RUN if [ ${INSTALL_PYTHON} = true ]; then \ && python -m pip install --upgrade virtualenv \ ;fi +########################################################################### +# PYTHON3: +########################################################################### + +ARG INSTALL_PYTHON3=false + +RUN if [ ${INSTALL_PYTHON3} = true ]; then \ + apt-get -y install python3 python3-pip python3-dev build-essential \ + && python3 -m pip install --upgrade --force-reinstall pip \ + && python3 -m pip install --upgrade virtualenv \ +;fi + ########################################################################### # POWERLINE: ########################################################################### @@ -1123,10 +1162,10 @@ ARG INSTALL_PG_CLIENT=false RUN if [ ${INSTALL_PG_CLIENT} = true ]; then \ # Install the pgsql client apt-get install wget \ - && add-apt-repository "deb http://apt.postgresql.org/pub/repos/apt/ xenial-pgdg main" \ && wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - \ + && echo "deb http://apt.postgresql.org/pub/repos/apt/ `lsb_release -cs`-pgdg main" | tee /etc/apt/sources.list.d/pgdg.list \ && apt-get update \ - && apt-get -y install postgresql-client-10 \ + && apt-get -y install postgresql-client-12 \ ;fi ########################################################################### @@ -1164,11 +1203,19 @@ ARG LARADOCK_PHALCON_VERSION ENV LARADOCK_PHALCON_VERSION ${LARADOCK_PHALCON_VERSION} RUN if [ $INSTALL_PHALCON = true ]; then \ - apt-get update && apt-get install -y unzip libpcre3-dev gcc make re2c \ + apt-get update && apt-get install -y unzip libpcre3-dev gcc make re2c git automake autoconf\ + && git clone https://github.com/jbboehr/php-psr.git \ + && cd php-psr \ + && phpize \ + && ./configure \ + && make \ + && make test \ + && make install \ && curl -L -o /tmp/cphalcon.zip https://github.com/phalcon/cphalcon/archive/v${LARADOCK_PHALCON_VERSION}.zip \ && unzip -d /tmp/ /tmp/cphalcon.zip \ && cd /tmp/cphalcon-${LARADOCK_PHALCON_VERSION}/build \ && ./install \ + && echo "extension=psr.so" >> /etc/php/${LARADOCK_PHP_VERSION}/mods-available/phalcon.ini \ && echo "extension=phalcon.so" >> /etc/php/${LARADOCK_PHP_VERSION}/mods-available/phalcon.ini \ && ln -s /etc/php/${LARADOCK_PHP_VERSION}/mods-available/phalcon.ini /etc/php/${LARADOCK_PHP_VERSION}/cli/conf.d/30-phalcon.ini \ && rm -rf /tmp/cphalcon* \ @@ -1232,6 +1279,20 @@ RUN if [ ${INSTALL_YAML} = true ]; then \ ln -s /etc/php/${LARADOCK_PHP_VERSION}/mods-available/yaml.ini /etc/php/${LARADOCK_PHP_VERSION}/cli/conf.d/35-yaml.ini \ ;fi +########################################################################### +# RDKAFKA: +########################################################################### + +ARG INSTALL_RDKAFKA=false + +RUN if [ ${INSTALL_RDKAFKA} = true ]; then \ + apt-get install -y librdkafka-dev && \ + pecl install rdkafka && \ + echo "extension=rdkafka.so" >> /etc/php/${LARADOCK_PHP_VERSION}/mods-available/rdkafka.ini && \ + ln -s /etc/php/${LARADOCK_PHP_VERSION}/mods-available/rdkafka.ini /etc/php/${LARADOCK_PHP_VERSION}/cli/conf.d/20-rdkafka.ini \ + && php -m | grep -q 'rdkafka' \ +;fi + ########################################################################### # FFMpeg: ########################################################################### @@ -1259,9 +1320,14 @@ RUN if [ ${INSTALL_WKHTMLTOPDF} = true ]; then \ libx11-dev \ libjpeg62 \ libxtst6 \ + fontconfig \ + libjpeg-turbo8-dev \ + xfonts-base \ + xfonts-75dpi \ wget \ - && wget https://github.com/h4cc/wkhtmltopdf-amd64/blob/master/bin/wkhtmltopdf-amd64?raw=true -O /usr/local/bin/wkhtmltopdf \ - && chmod +x /usr/local/bin/wkhtmltopdf \ + && wget https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-1/wkhtmltox_0.12.6-1.bionic_amd64.deb \ + && dpkg -i wkhtmltox_0.12.6-1.bionic_amd64.deb \ + && apt -f install \ ;fi ########################################################################### @@ -1300,6 +1366,47 @@ RUN if [ ${INSTALL_GIT_PROMPT} = true ]; then \ rm /tmp/git-prompt \ ;fi +########################################################################### +# XMLRPC: +########################################################################### + +ARG INSTALL_XMLRPC=false + +RUN if [ ${INSTALL_XMLRPC} = true ]; then \ + docker-php-ext-install xmlrpc \ +;fi + +########################################################################### +# Lnav: +########################################################################### + +ARG INSTALL_LNAV=false + +RUN if [ ${INSTALL_LNAV} = true ]; then \ + apt-get install -y lnav \ +;fi + +########################################################################### +# Protoc: +########################################################################### + +ARG INSTALL_PROTOC=false +ARG PROTOC_VERSION + +RUN if [ ${INSTALL_PROTOC} = true ]; then \ + if [ ${PROTOC_VERSION} = "latest" ]; then \ + REAL_PROTOC_VERSION=$(curl -s https://api.github.com/repos/protocolbuffers/protobuf/releases/latest | \ + sed -nr 's/.*"tag_name":\s?"v(.+?)".*/\1/p'); \ + else \ + REAL_PROTOC_VERSION=${PROTOC_VERSION}; \ + fi && \ + PROTOC_ZIP=protoc-${REAL_PROTOC_VERSION}-linux-x86_64.zip; \ + curl -L -o /tmp/protoc.zip https://github.com/protocolbuffers/protobuf/releases/download/v${REAL_PROTOC_VERSION}/${PROTOC_ZIP} && \ + unzip -q -o /tmp/protoc.zip -d /usr/local bin/protoc && \ + unzip -q -o /tmp/protoc.zip -d /usr/local 'include/*' && \ + rm -f /tmp/protoc.zip \ +;fi + ########################################################################### # Check PHP version: ###########################################################################