├── .github └── workflows │ ├── build_php.yml │ └── build_push_php.yml ├── .gitignore ├── README.md ├── ansible-aws-cli ├── Dockerfile └── README.md ├── composer └── README.md ├── github-changelog-generator └── master │ ├── Dockerfile │ └── README.md ├── nginx ├── README.md ├── swoole │ ├── Dockerfile │ └── config │ │ └── sites-enabled │ │ └── www.conf ├── symfony │ ├── Dockerfile │ └── config │ │ └── sites-enabled │ │ └── www.conf ├── www │ ├── Dockerfile │ └── config │ │ ├── conf.d │ │ ├── basic.conf │ │ ├── directive-only │ │ │ ├── cross-domain-insecure.conf │ │ │ ├── extra-security.conf │ │ │ ├── ssl.conf │ │ │ └── x-ua-compatible.conf │ │ └── location │ │ │ ├── cross-domain-fonts.conf │ │ │ └── expires.conf │ │ ├── fastcgi_params │ │ ├── mime.types │ │ ├── nginx.conf │ │ ├── sites-enabled │ │ └── www.conf │ │ └── ssl │ │ ├── dhparam.pem │ │ ├── nginx.crt │ │ └── nginx.key └── zray │ ├── Dockerfile │ └── config │ └── sites-enabled │ └── zray.conf ├── php-cs-test ├── Dockerfile ├── README.md └── rules.php ├── php ├── README.md ├── config │ ├── amqp.ini │ ├── fpm │ │ ├── php-fpm.conf │ │ └── pool.d │ │ │ └── www.conf │ ├── mongodb.ini │ ├── opcache.ini │ ├── parallel.ini │ ├── php-cli.ini │ ├── php.ini │ ├── php7.ini │ ├── protobuf.ini │ ├── redis.ini │ ├── simdjson.ini │ ├── swoole.ini │ ├── xdebug-cli.ini │ └── xdebug.ini ├── docker-compose.yml ├── inc │ ├── cli-blackfire.m4 │ ├── cli-xdebug-beta.m4 │ ├── cli-xdebug.m4 │ ├── cli.m4 │ ├── composer.m4 │ ├── composer2.m4 │ ├── fpm-blackfire.m4 │ ├── fpm-xdebug-beta.m4 │ ├── fpm-xdebug.m4 │ ├── fpm.m4 │ ├── macros.m4 │ ├── opcache.m4 │ ├── php-ext-amqp.m4 │ ├── php-ext-cleanup.m4 │ ├── php-ext-mongodb.m4 │ ├── php-ext-parallel.m4 │ ├── php-ext-protobuff.m4 │ ├── php-ext-redis.m4 │ ├── php-ext-simdjson.m4 │ ├── php-ext-swoole.m4 │ ├── php-ext.m4 │ ├── xdebug-beta.m4 │ └── xdebug.m4 ├── m4 │ ├── php-cli.m4 │ ├── php-fpm.m4 │ └── php-zts.m4 ├── makefile ├── php-cli ├── php-fpm └── php-zts └── rabbitmq ├── Dockerfile ├── README.md ├── config ├── etc │ ├── enabled_plugins │ └── rabbitmq-prooph.config ├── opt │ └── definitions.json └── ssl │ ├── cacert.pem │ ├── localhost.crt │ └── localhost.key └── test ├── bunny.html ├── bunny.png ├── echo.html ├── index.html ├── main.css ├── pencil.cur ├── stomp.js └── temp-queue.html /.github/workflows/build_php.yml: -------------------------------------------------------------------------------- 1 | on: 2 | pull_request: 3 | 4 | name: "Build PHP Docker Images" 5 | 6 | jobs: 7 | build-and-push-docker: 8 | name: "Build PHP Docker Images" 9 | 10 | runs-on: ${{ matrix.operating-system }} 11 | 12 | strategy: 13 | fail-fast: false 14 | matrix: 15 | php-version: 16 | - "8.0" 17 | - "8.1" 18 | - "8.2" 19 | php-target: 20 | - "cli" 21 | - "fpm" 22 | - "zts" 23 | operating-system: 24 | - "ubuntu-latest" 25 | 26 | steps: 27 | - name: "Checkout" 28 | uses: actions/checkout@master 29 | 30 | - name: "Install Docker Composer 2.x" 31 | run: | 32 | curl -fL https://raw.githubusercontent.com/docker/compose-switch/master/install_on_linux.sh | sudo sh 33 | sudo update-alternatives --display docker-compose 34 | docker -v 35 | docker-compose -v 36 | 37 | - name: "Build ${{ matrix.php-target }} ${{ matrix.php-version }}" 38 | working-directory: php 39 | env: 40 | PHP_VERSION: ${{ matrix.php-version }} 41 | PHP_TARGET: ${{ matrix.php-target }} 42 | DOCKER_REGISTRY: "prooph/docker-files/" 43 | run: docker-compose build 44 | -------------------------------------------------------------------------------- /.github/workflows/build_push_php.yml: -------------------------------------------------------------------------------- 1 | on: 2 | schedule: 3 | - cron: '0 0 * * 0,3' 4 | push: 5 | branches: 6 | - 'master' 7 | 8 | name: "Build And Push PHP Docker Images" 9 | 10 | jobs: 11 | build-and-push-docker: 12 | name: "Build And Push PHP Docker Images" 13 | 14 | runs-on: ${{ matrix.operating-system }} 15 | 16 | strategy: 17 | fail-fast: false 18 | matrix: 19 | php-version: 20 | - "8.0" 21 | - "8.1" 22 | - "8.2" 23 | php-target: 24 | - "cli" 25 | - "fpm" 26 | - "zts" 27 | operating-system: 28 | - "ubuntu-latest" 29 | 30 | steps: 31 | - name: "Checkout" 32 | uses: actions/checkout@master 33 | 34 | - name: "Install Docker Composer 2.x" 35 | run: | 36 | curl -fL https://raw.githubusercontent.com/docker/compose-switch/master/install_on_linux.sh | sudo sh 37 | sudo update-alternatives --display docker-compose 38 | docker -v 39 | docker-compose -v 40 | 41 | - name: "Build ${{ matrix.php-target }} ${{ matrix.php-version }}" 42 | working-directory: php 43 | env: 44 | PHP_VERSION: ${{ matrix.php-version }} 45 | PHP_TARGET: ${{ matrix.php-target }} 46 | DOCKER_REGISTRY: "ghcr.io/prooph/docker-files/" 47 | run: docker-compose build 48 | 49 | - name: Login to GitHub Container Registry 50 | uses: docker/login-action@v2 51 | with: 52 | registry: ghcr.io 53 | username: ${{ github.actor }} 54 | password: ${{ secrets.GITHUB_TOKEN }} 55 | 56 | - name: "Push PHP images to ghcr.io" 57 | working-directory: php 58 | env: 59 | PHP_VERSION: ${{ matrix.php-version }} 60 | PHP_TARGET: ${{ matrix.php-target }} 61 | DOCKER_REGISTRY: "ghcr.io/prooph/docker-files/" 62 | run: "docker-compose push" 63 | 64 | - name: "Push Composer images to ghcr.io" 65 | working-directory: php 66 | env: 67 | PHP_VERSION: ${{ matrix.php-version }} 68 | PHP_TARGET: ${{ matrix.php-target }} 69 | DOCKER_REGISTRY: "ghcr.io/prooph/docker-files/" 70 | if: matrix.php-target == 'cli' || matrix.php-target == 'zts' 71 | run: | 72 | docker tag ${DOCKER_REGISTRY}composer:${PHP_VERSION}-${PHP_TARGET} ${DOCKER_REGISTRY}composer:${PHP_VERSION} 73 | docker push ${DOCKER_REGISTRY}composer:${PHP_VERSION} 74 | docker tag ${DOCKER_REGISTRY}composer:${PHP_VERSION}-${PHP_TARGET}-1x ${DOCKER_REGISTRY}composer:${PHP_VERSION}-1x 75 | docker push ${DOCKER_REGISTRY}composer:${PHP_VERSION}-1x 76 | 77 | - name: Login to Docker Hub 78 | uses: docker/login-action@v2 79 | with: 80 | username: ${{ secrets.DOCKERHUB_USERNAME }} 81 | password: ${{ secrets.DOCKERHUB_TOKEN }} 82 | 83 | - name: "Push PHP images to Docker HUB" 84 | working-directory: php 85 | env: 86 | PHP_VERSION: ${{ matrix.php-version }} 87 | PHP_TARGET: ${{ matrix.php-target }} 88 | DOCKER_REGISTRY: "ghcr.io/prooph/docker-files/" 89 | DOCKER_HUB_REGISTRY: "prooph/" 90 | run: | 91 | docker tag ${DOCKER_REGISTRY}php:${PHP_VERSION}-${PHP_TARGET} ${DOCKER_HUB_REGISTRY}php:${PHP_VERSION}-${PHP_TARGET} 92 | docker push ${DOCKER_HUB_REGISTRY}php:${PHP_VERSION}-${PHP_TARGET} 93 | docker tag ${DOCKER_REGISTRY}php:${PHP_VERSION}-${PHP_TARGET}-blackfire ${DOCKER_HUB_REGISTRY}php:${PHP_VERSION}-${PHP_TARGET}-blackfire 94 | docker push ${DOCKER_HUB_REGISTRY}php:${PHP_VERSION}-${PHP_TARGET}-blackfire 95 | docker tag ${DOCKER_REGISTRY}php:${PHP_VERSION}-${PHP_TARGET}-opcache ${DOCKER_HUB_REGISTRY}php:${PHP_VERSION}-${PHP_TARGET}-opcache 96 | docker push ${DOCKER_HUB_REGISTRY}php:${PHP_VERSION}-${PHP_TARGET}-opcache 97 | docker tag ${DOCKER_REGISTRY}php:${PHP_VERSION}-${PHP_TARGET}-xdebug ${DOCKER_HUB_REGISTRY}php:${PHP_VERSION}-${PHP_TARGET}-xdebug 98 | docker push ${DOCKER_HUB_REGISTRY}php:${PHP_VERSION}-${PHP_TARGET}-xdebug 99 | 100 | - name: "Push Composer images to Docker HUB" 101 | working-directory: php 102 | env: 103 | PHP_VERSION: ${{ matrix.php-version }} 104 | PHP_TARGET: ${{ matrix.php-target }} 105 | DOCKER_REGISTRY: "ghcr.io/prooph/docker-files/" 106 | DOCKER_HUB_REGISTRY: "prooph/" 107 | if: matrix.php-target == 'cli' || matrix.php-target == 'zts' 108 | run: | 109 | docker tag ${DOCKER_REGISTRY}composer:${PHP_VERSION}-${PHP_TARGET} ${DOCKER_HUB_REGISTRY}composer:${PHP_VERSION} 110 | docker push ${DOCKER_HUB_REGISTRY}composer:${PHP_VERSION} 111 | docker tag ${DOCKER_REGISTRY}composer:${PHP_VERSION}-${PHP_TARGET}-1x ${DOCKER_HUB_REGISTRY}composer:${PHP_VERSION}-1x 112 | docker push ${DOCKER_HUB_REGISTRY}composer:${PHP_VERSION}-1x 113 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # docker-files 2 | 3 | > These images are only for development environments 4 | 5 | Collection of prooph docker files. Please look at the sub folders for more details or see 6 | [prooph/proophessor-do app](https://github.com/prooph/proophessor-do) for a nginx/php-fpm example. 7 | -------------------------------------------------------------------------------- /ansible-aws-cli/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM docker:1.12 2 | 3 | RUN set -xe \ 4 | && apk add --no-cache --virtual .build-deps \ 5 | autoconf \ 6 | cmake \ 7 | file \ 8 | g++ \ 9 | gcc \ 10 | libc-dev \ 11 | openssl-dev \ 12 | python-dev \ 13 | libffi-dev \ 14 | make \ 15 | git \ 16 | pkgconf \ 17 | re2c 18 | 19 | RUN apk add --no-cache --virtual .persistent-deps \ 20 | py-pip \ 21 | libffi \ 22 | curl \ 23 | openssl \ 24 | groff \ 25 | less \ 26 | python \ 27 | && pip install --upgrade \ 28 | awscli \ 29 | ansible \ 30 | boto \ 31 | pip \ 32 | && mkdir /app \ 33 | && apk del .build-deps 34 | 35 | WORKDIR /app 36 | 37 | # Set up the application directory 38 | VOLUME ["/app"] 39 | 40 | # Setup user home 41 | VOLUME ["/root"] 42 | 43 | CMD ["ansible", "--help"] 44 | -------------------------------------------------------------------------------- /ansible-aws-cli/README.md: -------------------------------------------------------------------------------- 1 | # Ansible + Amazon AWS CLI + Docker Image 2 | This container contains Ansible, Amazon AWS CLI and Docker. 3 | 4 | ## Configuration files 5 | You should mount specific config folders like `~/.aws` and `~/.ansible` to `/root`. 6 | [boto](http://boto.cloudhackers.com/en/latest/getting_started.html) is also installed and can be configured. 7 | 8 | ## Using Ansible 9 | Run the following command with your arguments from the root of your Ansible project. 10 | 11 | ```bash 12 | $ docker run -it --rm -v $(pwd):/app prooph/ansible-aws-cli ansible --help 13 | $ docker run -it --rm -v $(pwd):/app prooph/ansible-aws-cli ansible-playbook --help 14 | ``` 15 | 16 | ## Using Amazon AWS CLI 17 | 18 | ```bash 19 | $ docker run -it --rm -v ~/.aws:/root/.aws prooph/ansible-aws-cli aws help 20 | ``` 21 | 22 | ## Using Amazon AWS ECR 23 | To login to the Amazon Container Registry (ECR) with your Amazon AWS credentials use: 24 | 25 | ```bash 26 | $ docker run -it --rm -v ~/.aws:/root/.aws -v /var/run/docker.sock:/var/run/docker.sock prooph/ansible-aws-cli aws ecr get-login --region eu-central-1 | tr -d '\r\n' | xargs xargs 27 | ``` 28 | -------------------------------------------------------------------------------- /composer/README.md: -------------------------------------------------------------------------------- 1 | # PHP Composer Docker files 2 | 3 | > Is moved to [`php`](../php) folder 4 | -------------------------------------------------------------------------------- /github-changelog-generator/master/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ruby:2.2 2 | 3 | RUN gem install github_changelog_generator 4 | 5 | # Set up the application directory 6 | VOLUME ["/app"] 7 | WORKDIR /app 8 | 9 | CMD ["--help"] 10 | ENTRYPOINT ["github_changelog_generator"] 11 | -------------------------------------------------------------------------------- /github-changelog-generator/master/README.md: -------------------------------------------------------------------------------- 1 | # Docker GitHub Changelog Generator image 2 | This container generates your GitHub CHANGELOG.md by using [GitHub Changelog Generator](https://github.com/skywinder/github-changelog-generator). 3 | 4 | ## Generate the Changelog 5 | Run the following command with your arguments. 6 | 7 | ```bash 8 | $ docker run -it --rm -v $(pwd):/app prooph/github-changelog-generator 9 | ``` 10 | -------------------------------------------------------------------------------- /nginx/README.md: -------------------------------------------------------------------------------- 1 | # nginx Docker files 2 | 3 | > These images are only for development environments 4 | 5 | Configures nginx with SSL and HTTP/2 and some optimizations. The *vhost* uses the `/var/www/public` folder, sou you can 6 | mount your application to `/var/www/`. See [prooph/proophessor-do app](https://github.com/prooph/proophessor-do) for an 7 | example. 8 | 9 | ## nginx swoole 10 | Use the following image: `prooph/nginx:swoole`. 11 | 12 | A Docker Compose example to run your [Zend Expressive](https://docs.zendframework.com/zend-expressive-swoole/intro/#swoole-with-expressive) application with [swoole](https://www.swoole.co.uk/). 13 | 14 | ``` 15 | version: '2' 16 | services: 17 | nginx: 18 | image: prooph/nginx:swoole 19 | ports: 20 | - 80:80 21 | - 443:443 22 | volumes: 23 | - .:/var/www 24 | 25 | php: 26 | image: prooph/php:7.2-cli 27 | volumes: 28 | - .:/var/www 29 | command: 30 | php 31 | /var/www/public/index.php 32 | start 33 | ``` 34 | 35 | ## nginx www 36 | Use the following image: `prooph/nginx:www`. 37 | 38 | A Docker Compose example: 39 | 40 | ``` 41 | version: '2' 42 | services: 43 | nginx: 44 | image: prooph/nginx:www 45 | ports: 46 | - 80:80 47 | - 443:443 48 | volumes: 49 | - .:/var/www 50 | 51 | php: 52 | image: prooph/php:7.2-fpm 53 | volumes: 54 | - .:/var/www 55 | ``` 56 | 57 | ## nginx with Zend Z-Ray 58 | Use the following image: `prooph/nginx:zray`. 59 | 60 | [Zend Z-Ray](http://www.zend.com/de/products/server/z-ray) is a PHP Profiler and is used together with 61 | one of the `prooph/php:[version]-fpm-zray` Docker images. 62 | 63 | ## nginx for Symfony 64 | Use the following image: `prooph/nginx:symfony`. 65 | 66 | The Symfony edition of nginx is exactly equal to the www edition except is uses the /var/www/web folder as document root, as this is Symfony convention. 67 | -------------------------------------------------------------------------------- /nginx/swoole/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM prooph/nginx:www 2 | 3 | COPY config/ /etc/nginx/ 4 | 5 | WORKDIR /var/www 6 | -------------------------------------------------------------------------------- /nginx/swoole/config/sites-enabled/www.conf: -------------------------------------------------------------------------------- 1 | # SSL termination 2 | map $http_x_forwarded_proto $forwarded_proto_https { 3 | default on; 4 | https on; 5 | } 6 | 7 | server { 8 | listen 80; 9 | listen 443 ssl http2; 10 | server_name _; # catch all 11 | root /var/www/public; 12 | 13 | index index.php; 14 | 15 | include conf.d/basic.conf; 16 | 17 | location = /index.php { 18 | # Ensure that there is no such file named "not_exists" 19 | # in your "public" directory. 20 | try_files /not_exists @swoole; 21 | } 22 | 23 | location / { 24 | # This is cool because no php is touched for static content. 25 | # include the "?$args" part so non-default permalinks doesn't break when using query string 26 | try_files $uri $uri/ @swoole; 27 | } 28 | 29 | location @swoole { 30 | set $upstream php; 31 | set $suffix ""; 32 | 33 | if ($uri = /index.php) { 34 | set $suffix "/"; 35 | } 36 | 37 | proxy_http_version 1.1; 38 | proxy_set_header Connection "keep-alive"; 39 | proxy_set_header Host $http_host; 40 | proxy_set_header Scheme $scheme; 41 | proxy_set_header SERVER_PORT $server_port; 42 | proxy_set_header REMOTE_ADDR $remote_addr; 43 | proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 44 | proxy_set_header X-Forwarded-Proto https; 45 | 46 | proxy_pass http://$upstream$suffix; 47 | 48 | # for debugging 1h 49 | proxy_connect_timeout 3600s; 50 | proxy_send_timeout 3600s; 51 | proxy_read_timeout 3600s; 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /nginx/symfony/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM prooph/nginx:www 2 | 3 | COPY config/ /etc/nginx/ 4 | 5 | WORKDIR /var/www 6 | -------------------------------------------------------------------------------- /nginx/symfony/config/sites-enabled/www.conf: -------------------------------------------------------------------------------- 1 | server { 2 | listen 80; 3 | listen 443 ssl http2; 4 | server_name _; # catch all 5 | root /var/www/web; 6 | 7 | index index.php; 8 | 9 | include conf.d/basic.conf; 10 | 11 | location / { 12 | # This is cool because no php is touched for static content. 13 | # include the "?$args" part so non-default permalinks doesn't break when using query string 14 | try_files $uri $uri/ /index.php$is_args$args; 15 | } 16 | 17 | location ~ \.php$ { 18 | set $upstream php:9000; 19 | 20 | fastcgi_split_path_info ^(.+\.php)(/.+)$; 21 | fastcgi_pass $upstream; 22 | fastcgi_index index.php; 23 | fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; 24 | include fastcgi_params; 25 | fastcgi_param PATH_INFO $fastcgi_path_info; 26 | 27 | # for debugging 1h 28 | proxy_connect_timeout 3600s; 29 | proxy_send_timeout 3600s; 30 | proxy_read_timeout 3600s; 31 | fastcgi_send_timeout 3600s; 32 | fastcgi_read_timeout 3600s; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /nginx/www/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM nginx:1.17-alpine 2 | 3 | COPY config/ /etc/nginx/ 4 | 5 | WORKDIR /var/www 6 | -------------------------------------------------------------------------------- /nginx/www/config/conf.d/basic.conf: -------------------------------------------------------------------------------- 1 | # Basic h5bp rules 2 | # this is the internal Docker DNS 3 | resolver 127.0.0.11 valid=30s; 4 | 5 | include conf.d/directive-only/x-ua-compatible.conf; 6 | include conf.d/directive-only/extra-security.conf; 7 | include conf.d/directive-only/ssl.conf; 8 | include conf.d/directive-only/cross-domain-insecure.conf; 9 | include conf.d/location/expires.conf; 10 | include conf.d/location/cross-domain-fonts.conf; 11 | -------------------------------------------------------------------------------- /nginx/www/config/conf.d/directive-only/cross-domain-insecure.conf: -------------------------------------------------------------------------------- 1 | # Cross domain AJAX requests 2 | 3 | # http://www.w3.org/TR/cors/#access-control-allow-origin-response-header 4 | 5 | # **Security Warning** 6 | # Do not use this without understanding the consequences. 7 | # This will permit access from any other website. 8 | # 9 | add_header "Access-Control-Allow-Origin" "*"; 10 | 11 | # Instead of using this file, consider using a specific rule such as: 12 | # 13 | # Allow access based on [sub]domain: 14 | # add_header "Access-Control-Allow-Origin" "subdomain.example.com"; 15 | -------------------------------------------------------------------------------- /nginx/www/config/conf.d/directive-only/extra-security.conf: -------------------------------------------------------------------------------- 1 | # The X-Frame-Options header indicates whether a browser should be allowed 2 | # to render a page within a frame or iframe. 3 | add_header X-Frame-Options SAMEORIGIN; 4 | 5 | # MIME type sniffing security protection 6 | # There are very few edge cases where you wouldn't want this enabled. 7 | add_header X-Content-Type-Options nosniff; 8 | 9 | # The X-XSS-Protection header is used by Internet Explorer version 8+ 10 | # The header instructs IE to enable its inbuilt anti-cross-site scripting filter. 11 | add_header X-XSS-Protection "1; mode=block"; 12 | 13 | # with Content Security Policy (CSP) enabled (and a browser that supports it (http://caniuse.com/#feat=contentsecuritypolicy), 14 | # you can tell the browser that it can only download content from the domains you explicitly allow 15 | # CSP can be quite difficult to configure, and cause real issues if you get it wrong 16 | # There is website that helps you generate a policy here http://cspisawesome.com/ 17 | # add_header Content-Security-Policy "default-src 'self'; style-src 'self' 'unsafe-inline'; script-src 'self' https://www.google-analytics.com;"; 18 | -------------------------------------------------------------------------------- /nginx/www/config/conf.d/directive-only/ssl.conf: -------------------------------------------------------------------------------- 1 | #ssl on 2 | 3 | # Protect against the BEAST and POODLE attacks by not using SSLv3 at all. If you need to support older browsers (IE6) you may need to add 4 | # SSLv3 to the list of protocols below. 5 | ssl_protocols TLSv1 TLSv1.1 TLSv1.2; 6 | 7 | # Ciphers set to best allow protection from Beast, while providing forwarding secrecy, as defined by Mozilla (Intermediate Set) - https://wiki.mozilla.org/Security/Server_Side_TLS#Nginx 8 | ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA-AES256-SHA:ECDHE-RSA-DES-CBC3-SHA:ECDHE-ECDSA-DES-CBC3-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:AES:CAMELLIA:DES-CBC3-SHA:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!aECDH:!EDH-DSS-DES-CBC3-SHA:!EDH-RSA-DES-CBC3-SHA:!KRB5-DES-CBC3-SHA; 9 | ssl_prefer_server_ciphers on; 10 | 11 | # Optimize SSL by caching session parameters for 10 minutes. This cuts down on the number of expensive SSL handshakes. 12 | # The handshake is the most CPU-intensive operation, and by default it is re-negotiated on every new/parallel connection. 13 | # By enabling a cache (of type "shared between all Nginx workers"), we tell the client to re-use the already negotiated state. 14 | # Further optimization can be achieved by raising keepalive_timeout, but that shouldn't be done unless you serve primarily HTTPS. 15 | ssl_session_cache shared:SSL:10m; # a 1mb cache can hold about 4000 sessions, so we can hold 40000 sessions 16 | ssl_session_timeout 24h; 17 | 18 | # SSL buffer size was added in 1.5.9 19 | ssl_buffer_size 1400; # 1400 bytes to fit in one MTU 20 | 21 | # Session tickets appeared in version 1.5.9 22 | # 23 | # nginx does not auto-rotate session ticket keys: only a HUP / restart will do so and 24 | # when a restart is performed the previous key is lost, which resets all previous 25 | # sessions. The fix for this is to setup a manual rotation mechanism: 26 | # http://trac.nginx.org/nginx/changeset/1356a3b9692441e163b4e78be4e9f5a46c7479e9/nginx 27 | # 28 | # Note that you'll have to define and rotate the keys securely by yourself. In absence 29 | # of such infrastructure, consider turning off session tickets: 30 | #ssl_session_tickets off; 31 | 32 | # Use a higher keepalive timeout to reduce the need for repeated handshakes 33 | keepalive_timeout 300; # up from 75 secs default 34 | 35 | # HSTS (HTTP Strict Transport Security) 36 | # This header tells browsers to cache the certificate for a year and to connect exclusively via HTTPS. 37 | add_header Strict-Transport-Security "max-age=31536000;"; 38 | # This version tells browsers to treat all subdomains the same as this site and to load exclusively over HTTPS 39 | add_header Strict-Transport-Security "max-age=31536000; includeSubdomains;"; 40 | 41 | # This default SSL certificate will be served whenever the client lacks support for SNI (Server Name Indication). 42 | # Make it a symlink to the most important certificate you have, so that users of IE 8 and below on WinXP can see your main site without SSL errors. 43 | ssl_certificate /etc/nginx/ssl/nginx.crt; 44 | ssl_certificate_key /etc/nginx/ssl/nginx.key; 45 | ssl_dhparam /etc/nginx/ssl/dhparam.pem; 46 | -------------------------------------------------------------------------------- /nginx/www/config/conf.d/directive-only/x-ua-compatible.conf: -------------------------------------------------------------------------------- 1 | # Force the latest IE version 2 | add_header "X-UA-Compatible" "IE=Edge"; 3 | -------------------------------------------------------------------------------- /nginx/www/config/conf.d/location/cross-domain-fonts.conf: -------------------------------------------------------------------------------- 1 | # Cross domain webfont access 2 | location ~* \.(?:ttf|ttc|otf|eot|woff|woff2)$ { 3 | include conf.d/directive-only/cross-domain-insecure.conf; 4 | 5 | # Also, set cache rules for webfonts. 6 | # 7 | # See http://wiki.nginx.org/HttpCoreModule#location 8 | # And https://github.com/h5bp/server-configs/issues/85 9 | # And https://github.com/h5bp/server-configs/issues/86 10 | expires 1M; 11 | access_log off; 12 | add_header Cache-Control "public"; 13 | } 14 | -------------------------------------------------------------------------------- /nginx/www/config/conf.d/location/expires.conf: -------------------------------------------------------------------------------- 1 | # Expire rules for static content 2 | 3 | # No default expire rule. This config mirrors that of apache as outlined in the 4 | # html5-boilerplate .htaccess file. However, nginx applies rules by location, 5 | # the apache rules are defined by type. A consequence of this difference is that 6 | # if you use no file extension in the url and serve html, with apache you get an 7 | # expire time of 0s, with nginx you'd get an expire header of one month in the 8 | # future (if the default expire rule is 1 month). Therefore, do not use a 9 | # default expire rule with nginx unless your site is completely static 10 | 11 | # cache.appcache, your document html and data 12 | location ~* \.(?:manifest|appcache|html?|xml|json)$ { 13 | expires -1; 14 | access_log off; 15 | } 16 | 17 | # Feed 18 | location ~* \.(?:rss|atom)$ { 19 | expires 1h; 20 | add_header Cache-Control "public"; 21 | } 22 | 23 | # Media: images, icons, video, audio, HTC 24 | location ~* \.(?:jpg|jpeg|gif|png|ico|cur|gz|svg|svgz|mp4|ogg|ogv|webm|htc)$ { 25 | expires 1M; 26 | access_log off; 27 | add_header Cache-Control "public"; 28 | } 29 | 30 | # CSS and Javascript 31 | location ~* \.(?:css|js)$ { 32 | expires 1y; 33 | access_log off; 34 | add_header Cache-Control "public"; 35 | } 36 | 37 | # WebFonts 38 | # If you are NOT using cross-domain-fonts.conf, uncomment the following directive 39 | # location ~* \.(?:ttf|ttc|otf|eot|woff|woff2)$ { 40 | # expires 1M; 41 | # access_log off; 42 | # add_header Cache-Control "public"; 43 | # } 44 | -------------------------------------------------------------------------------- /nginx/www/config/fastcgi_params: -------------------------------------------------------------------------------- 1 | fastcgi_param QUERY_STRING $query_string; 2 | fastcgi_param REQUEST_METHOD $request_method; 3 | fastcgi_param CONTENT_TYPE $content_type; 4 | fastcgi_param CONTENT_LENGTH $content_length; 5 | 6 | fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; 7 | fastcgi_param SCRIPT_NAME $fastcgi_script_name; 8 | fastcgi_param PATH_INFO $fastcgi_path_info; 9 | fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info; 10 | fastcgi_param REQUEST_URI $request_uri; 11 | fastcgi_param DOCUMENT_URI $document_uri; 12 | fastcgi_param DOCUMENT_ROOT $document_root; 13 | fastcgi_param SERVER_PROTOCOL $server_protocol; 14 | 15 | fastcgi_param GATEWAY_INTERFACE CGI/1.1; 16 | fastcgi_param SERVER_SOFTWARE nginx/$nginx_version; 17 | 18 | fastcgi_param REMOTE_ADDR $remote_addr; 19 | fastcgi_param REMOTE_PORT $remote_port; 20 | fastcgi_param SERVER_ADDR $server_addr; 21 | fastcgi_param SERVER_PORT $server_port; 22 | fastcgi_param SERVER_NAME $server_name; 23 | 24 | fastcgi_param HTTPS $https; 25 | -------------------------------------------------------------------------------- /nginx/www/config/mime.types: -------------------------------------------------------------------------------- 1 | types { 2 | 3 | # Audio 4 | audio/midi mid midi kar; 5 | audio/mp4 aac f4a f4b m4a; 6 | audio/mpeg mp3; 7 | audio/ogg oga ogg opus; 8 | audio/x-realaudio ra; 9 | audio/x-wav wav; 10 | 11 | # Images 12 | image/bmp bmp; 13 | image/gif gif; 14 | image/jpeg jpeg jpg; 15 | image/png png; 16 | image/svg+xml svg svgz; 17 | image/tiff tif tiff; 18 | image/vnd.wap.wbmp wbmp; 19 | image/webp webp; 20 | image/x-icon ico cur; 21 | image/x-jng jng; 22 | 23 | # JavaScript 24 | application/javascript js; 25 | application/json json; 26 | 27 | # Manifest files 28 | application/x-web-app-manifest+json webapp; 29 | text/cache-manifest manifest appcache; 30 | 31 | # Microsoft Office 32 | application/msword doc; 33 | application/vnd.ms-excel xls; 34 | application/vnd.ms-powerpoint ppt; 35 | application/vnd.openxmlformats-officedocument.wordprocessingml.document docx; 36 | application/vnd.openxmlformats-officedocument.spreadsheetml.sheet xlsx; 37 | application/vnd.openxmlformats-officedocument.presentationml.presentation pptx; 38 | 39 | # Video 40 | video/3gpp 3gpp 3gp; 41 | video/mp4 mp4 m4v f4v f4p; 42 | video/mpeg mpeg mpg; 43 | video/ogg ogv; 44 | video/quicktime mov; 45 | video/webm webm; 46 | video/x-flv flv; 47 | video/x-mng mng; 48 | video/x-ms-asf asx asf; 49 | video/x-ms-wmv wmv; 50 | video/x-msvideo avi; 51 | 52 | # Web feeds 53 | application/xml atom rdf rss xml; 54 | 55 | # Web fonts 56 | application/font-woff woff; 57 | application/font-woff2 woff2; 58 | application/vnd.ms-fontobject eot; 59 | application/x-font-ttf ttc ttf; 60 | font/opentype otf; 61 | 62 | # Other 63 | application/java-archive jar war ear; 64 | application/mac-binhex40 hqx; 65 | application/pdf pdf; 66 | application/postscript ps eps ai; 67 | application/rtf rtf; 68 | application/vnd.wap.wmlc wmlc; 69 | application/xhtml+xml xhtml; 70 | application/vnd.google-earth.kml+xml kml; 71 | application/vnd.google-earth.kmz kmz; 72 | application/x-7z-compressed 7z; 73 | application/x-chrome-extension crx; 74 | application/x-opera-extension oex; 75 | application/x-xpinstall xpi; 76 | application/x-cocoa cco; 77 | application/x-java-archive-diff jardiff; 78 | application/x-java-jnlp-file jnlp; 79 | application/x-makeself run; 80 | application/x-perl pl pm; 81 | application/x-pilot prc pdb; 82 | application/x-rar-compressed rar; 83 | application/x-redhat-package-manager rpm; 84 | application/x-sea sea; 85 | application/x-shockwave-flash swf; 86 | application/x-stuffit sit; 87 | application/x-tcl tcl tk; 88 | application/x-x509-ca-cert der pem crt; 89 | application/x-bittorrent torrent; 90 | application/zip zip; 91 | 92 | application/octet-stream bin exe dll; 93 | application/octet-stream deb; 94 | application/octet-stream dmg; 95 | application/octet-stream iso img; 96 | application/octet-stream msi msp msm; 97 | application/octet-stream safariextz; 98 | 99 | text/css css; 100 | text/html html htm shtml; 101 | text/mathml mml; 102 | text/plain txt; 103 | text/vnd.sun.j2me.app-descriptor jad; 104 | text/vnd.wap.wml wml; 105 | text/vtt vtt; 106 | text/x-component htc; 107 | text/x-vcard vcf; 108 | 109 | } 110 | -------------------------------------------------------------------------------- /nginx/www/config/nginx.conf: -------------------------------------------------------------------------------- 1 | # nginx Configuration File 2 | # http://wiki.nginx.org/Configuration 3 | 4 | # Run as a less privileged user for security reasons. 5 | user nginx; 6 | 7 | # How many worker threads to run; 8 | # "auto" sets it to the number of CPU cores available in the system, and 9 | # offers the best performance. Don't set it higher than the number of CPU 10 | # cores if changing this parameter. 11 | 12 | # The maximum number of connections for Nginx is calculated by: 13 | # max_clients = worker_processes * worker_connections 14 | worker_processes 2; 15 | 16 | # Maximum open file descriptors per process; 17 | # should be > worker_connections. 18 | worker_rlimit_nofile 8192; 19 | 20 | events { 21 | # When you need > 8000 * cpu_cores connections, you start optimizing your OS, 22 | # and this is probably the point at which you hire people who are smarter than 23 | # you, as this is *a lot* of requests. 24 | worker_connections 8000; 25 | } 26 | 27 | # Default error log file 28 | # (this is only used when you don't override error_log on a server{} level) 29 | error_log /var/log/nginx/error.log warn; 30 | pid /var/run/nginx.pid; 31 | 32 | http { 33 | # Hide nginx version information. 34 | server_tokens off; 35 | 36 | # Define the MIME types for files. 37 | include mime.types; 38 | default_type application/octet-stream; 39 | 40 | # Update charset_types due to updated mime.types 41 | charset_types text/xml text/plain text/vnd.wap.wml application/x-javascript application/rss+xml text/css application/javascript application/json; 42 | 43 | # Format to use in log files 44 | log_format main '$remote_addr - $remote_user [$time_local] "$request" ' 45 | '$status $body_bytes_sent "$http_referer" ' 46 | '"$http_user_agent" "$http_x_forwarded_for"'; 47 | 48 | log_format le_json '"time": "$time_iso8601", ' 49 | '"remote_addr": "$remote_addr", ' 50 | '"remote_user": "$remote_user", ' 51 | '"body_bytes_sent": "$body_bytes_sent", ' 52 | '"request_time": "$request_time", ' 53 | '"status": "$status", ' 54 | '"request": "$request", ' 55 | '"request_method": "$request_method", ' 56 | '"http_referrer": "$http_referer", ' 57 | '"http_user_agent": "$http_user_agent"'; 58 | 59 | # Default log file 60 | # (this is only used when you don't override access_log on a server{} level) 61 | access_log /var/log/nginx/access.log le_json; 62 | 63 | # How long to allow each connection to stay idle; longer values are better 64 | # for each individual client, particularly for SSL, but means that worker 65 | # connections are tied up longer. (Default: 65) 66 | keepalive_timeout 20; 67 | 68 | # Speed up file transfers by using sendfile() to copy directly 69 | # between descriptors rather than using read()/write(). 70 | sendfile on; 71 | 72 | # Tell Nginx not to send out partial frames; this increases throughput 73 | # since TCP frames are filled up before being sent out. (adds TCP_CORK) 74 | tcp_nopush on; 75 | 76 | # Compression 77 | 78 | # Enable Gzip compressed. 79 | gzip on; 80 | 81 | # Compression level (1-9). 82 | # 5 is a perfect compromise between size and cpu usage, offering about 83 | # 75% reduction for most ascii files (almost identical to level 9). 84 | gzip_comp_level 5; 85 | 86 | # Don't compress anything that's already small and unlikely to shrink much 87 | # if at all (the default is 20 bytes, which is bad as that usually leads to 88 | # larger files after gzipping). 89 | gzip_min_length 256; 90 | 91 | # Compress data even for clients that are connecting to us via proxies, 92 | # identified by the "Via" header (required for CloudFront). 93 | gzip_proxied any; 94 | 95 | # Tell proxies to cache both the gzipped and regular version of a resource 96 | # whenever the client's Accept-Encoding capabilities header varies; 97 | # Avoids the issue where a non-gzip capable client (which is extremely rare 98 | # today) would display gibberish if their proxy gave them the gzipped version. 99 | gzip_vary on; 100 | 101 | # Compress all output labeled with one of the following MIME-types. 102 | gzip_types 103 | application/atom+xml 104 | application/javascript 105 | application/json 106 | application/rss+xml 107 | application/vnd.ms-fontobject 108 | application/x-font-ttf 109 | application/x-web-app-manifest+json 110 | application/xhtml+xml 111 | application/xml 112 | font/opentype 113 | image/svg+xml 114 | image/x-icon 115 | text/css 116 | text/plain 117 | text/x-component; 118 | # text/html is always compressed by HttpGzipModule 119 | 120 | # This should be turned on if you are going to have pre-compressed copies (.gz) of 121 | # static files available. If not it should be left off as it will cause extra I/O 122 | # for the check. It is best if you enable this in a location{} block for 123 | # a specific directory, or on an individual server{} level. 124 | # gzip_static on; 125 | 126 | include sites-enabled/*; 127 | } 128 | -------------------------------------------------------------------------------- /nginx/www/config/sites-enabled/www.conf: -------------------------------------------------------------------------------- 1 | server { 2 | listen 80; 3 | listen 443 ssl http2; 4 | server_name _; # catch all 5 | root /var/www/public; 6 | 7 | index index.php; 8 | 9 | include conf.d/basic.conf; 10 | 11 | location / { 12 | # This is cool because no php is touched for static content. 13 | # include the "?$args" part so non-default permalinks doesn't break when using query string 14 | try_files $uri $uri/ /index.php$is_args$args; 15 | } 16 | 17 | location ~ \.php$ { 18 | set $upstream php:9000; 19 | 20 | fastcgi_split_path_info ^(.+\.php)(/.+)$; 21 | fastcgi_pass $upstream; 22 | fastcgi_index index.php; 23 | fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; 24 | include fastcgi_params; 25 | fastcgi_param PATH_INFO $fastcgi_path_info; 26 | 27 | # for debugging 1h 28 | proxy_connect_timeout 3600s; 29 | proxy_send_timeout 3600s; 30 | proxy_read_timeout 3600s; 31 | fastcgi_send_timeout 3600s; 32 | fastcgi_read_timeout 3600s; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /nginx/www/config/ssl/dhparam.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN DH PARAMETERS----- 2 | MIICCAKCAgEAgHmKmTqPEdFVI+eSADPYmG5Rx2LFwdFaBsOMMRVlkOUfcg3eesLl 3 | 4xhg5fbhjtakAUHOVI8a1oNSKUiJt1FEAQ5w3+ijUTMMOror4oj+nE8ruWXM8hEH 4 | +hmhOQQbv+FoLCSrmOP3jTCiyeQCx/NzhXb0ra+8BVDZgdH2DPB/ZTLQUBxhYp/C 5 | NvlYaaO2Kg140E/s761/fv5kZlogD522dYmbl9tDSr0Obiw1hMjMvoAi+ejFFEJl 6 | G9KDqaiSq2C70Ik1T1AIESHgmNVsqyZlUINo5LB6ZX0+h4oOCL596WcPlUvs2Ikf 7 | f08SjeFQ0KqW6BeU2G3kb2rEKnkOV5K4u5fwDQV35Mtf/15SyEM+XrtULfoHEjoB 8 | 0pAJmf3UTFP4zHr+YWle/ZpaO2U+ngVuBLxn5GhrYy3zWOOsRDXkFjzGOCzJ+ftl 9 | lzmqV0KN0dlD7U0TnAmleagFqhNw9FY9H2FYBvYhzQPr0dMYQxvkAprPqG3g+sNx 10 | 6yal8N4V6Qnj7SOUeRZeYZuKpVaanKIS1Kh0PeRmrITVStNLv4QkPyC+Db4sZFiA 11 | WXJBIGk4ABLm+5vc/2VwLHIkYDUP2t/y4y03T4rndvQHsXphCsEGb9jv0JPUK78m 12 | uPQNdcAIqAUr6CoX3D7N/dWG44xtM1h02QantbABjlbbAsRbcT3o6WMCAQI= 13 | -----END DH PARAMETERS----- 14 | -------------------------------------------------------------------------------- /nginx/www/config/ssl/nginx.crt: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIIDYjCCAkqgAwIBAgIJAPAjldzCILhaMA0GCSqGSIb3DQEBCwUAMEUxCzAJBgNV 3 | BAYTAkFVMRMwEQYDVQQIDApTb21lLVN0YXRlMSEwHwYDVQQKDBhJbnRlcm5ldCBX 4 | aWRnaXRzIFB0eSBMdGQwIBcNMTgwODEzMTYxOTUzWhgPMjA1MDAyMDUxNjE5NTNa 5 | MEUxCzAJBgNVBAYTAkFVMRMwEQYDVQQIDApTb21lLVN0YXRlMSEwHwYDVQQKDBhJ 6 | bnRlcm5ldCBXaWRnaXRzIFB0eSBMdGQwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAw 7 | ggEKAoIBAQCtL8aIsJADArMZC00WBdtGh7VlMnQx2WCntqshoQsYIrCtwPH6F51T 8 | GMp1qoCo8Sl8NEyjmDzf5OGIypDrXZZTaP2eb0qTPze2kslV1+uQtzbqCsfIgh8Q 9 | S2mggzeMc+3214L+SohPMja2Z+icVB9AVIij8nQCU+BfctaZhib1zT34ODbF2YUj 10 | 3OJ3MfzpNNCE8X6Jocmx7oBHnPTWUS0xySCnF+hILlCteNbRO4b25nYz2yt+bu/9 11 | QYdU+WWy4SMMlUSaGGNbxsKJLZrIf98VYmFDMxu4mBGiSkMEN9hIK33eESENy0Vw 12 | 8dTip4p/FNqkwadonZbNCsizMCVOFbV1AgMBAAGjUzBRMB0GA1UdDgQWBBSH7Nko 13 | Y+Ieiwje8fea+A6ZtYcAJDAfBgNVHSMEGDAWgBSH7NkoY+Ieiwje8fea+A6ZtYcA 14 | JDAPBgNVHRMBAf8EBTADAQH/MA0GCSqGSIb3DQEBCwUAA4IBAQB3UA4ImrCVOZGK 15 | XpuJZk5nrIcf1LIhjaKWkO+mb4g0BGPgzAoz0f0q/8SncUq8Jwr9GLYNfLjWXg+R 16 | rAphoxprk9t2m+eJaKngi0rYq0JW4Epk3Uzb+YMhFXpaou+su1SkYQ4dl22VeL+z 17 | Q6DHDH+xciHIrBtjcU/sUfmR0nT8i+Jmc+uRClrAGELiDSJxe3Dfcq5tgSZiqGwj 18 | X9DSduHPbY0REZ88uUaKBT9U8YykrGkZHisReJI3Y67ZuXITMhc7KOO4C5WmxEVt 19 | zTMF5K7mC+Cg4DXAKCM0VKw1qynWOJSEAVem6p4y5Qm1lFF2Oh6WUlfpX1IAGQOJ 20 | E4Dz4CK1 21 | -----END CERTIFICATE----- 22 | -------------------------------------------------------------------------------- /nginx/www/config/ssl/nginx.key: -------------------------------------------------------------------------------- 1 | -----BEGIN PRIVATE KEY----- 2 | MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCtL8aIsJADArMZ 3 | C00WBdtGh7VlMnQx2WCntqshoQsYIrCtwPH6F51TGMp1qoCo8Sl8NEyjmDzf5OGI 4 | ypDrXZZTaP2eb0qTPze2kslV1+uQtzbqCsfIgh8QS2mggzeMc+3214L+SohPMja2 5 | Z+icVB9AVIij8nQCU+BfctaZhib1zT34ODbF2YUj3OJ3MfzpNNCE8X6Jocmx7oBH 6 | nPTWUS0xySCnF+hILlCteNbRO4b25nYz2yt+bu/9QYdU+WWy4SMMlUSaGGNbxsKJ 7 | LZrIf98VYmFDMxu4mBGiSkMEN9hIK33eESENy0Vw8dTip4p/FNqkwadonZbNCsiz 8 | MCVOFbV1AgMBAAECggEAdYldFluuAT0Ny8ttr6qd3Moxg9KwJTzAalKA5jvjyaeR 9 | fPrbvr3UGhdTIHRtCTtSyma8NLMXbWRq5GmF3RcQ9N7mcWZamIBpEVGhrs7xoq+V 10 | Z1WVrTESX/6uWy9yvbHYKJSu5GI1DHqpwzXWGnLFGuXELnBX51SBjIXlux/exSY9 11 | tQHbYRsrG+/Fe/e1deakFqusz+sS5cG7KgUlEcIlSUab/lbN0jWrXjCasghFWILE 12 | ftju/OMyonqBkrzWajxw+6hyVDNZbRXs0BpiMIEGVzqijiLWfnqL6Coux2XRT8rU 13 | pJFTGvB8eZOhwhT/Yye0r727DJe6as+hgMOCsVvYQQKBgQDf8aS0S5dfZ68GZQJt 14 | cSSxAA/uNHfynwtDLvB5+57m+PretZzfb2oKwUCt2xPM1gc0SUm2oPX6rqLUw0Eb 15 | V7VxFasDU3JZ8mrFRlQg06pVk2vGN7QFmw5vKXtc6fbtCvD3jA8s+E1WFA6qIYOV 16 | kTj0EGbJpmjZdhmKC2IMxU4drQKBgQDF+iWBYOJiMpdFpIuS2BQGiC+rxykcN6mk 17 | bF7mH3shDiJFddVCX9rWdaQ8Dh29I86MfR84HviEjkJmScKk3QZbYyuyZNVFEnnH 18 | +aF17w9ahF0RrQ+nPg0Uf7P0+kKeVZjkUz1RtDNhL7F/4dnrSCLJyvw3OP+NMjuG 19 | gb4q1Q/f6QKBgQDNvOG1JjFGXConNMtbInQ0DLuV+ywrgURGj6wsVSeySRGpY65g 20 | c6o3gT3bu4ZgTE1IEwCewRfbG2/LCisZZKXz45U+M/69dgHzhV4q3msBvbNo4qoH 21 | 8GD9bV3BiczqD4A73Lfgd6oNJ9YlJS8PTODHEP5tye1Pw7lI4pZM50OR7QKBgEDn 22 | IdaJWY4Rwc/eArfQSLhfeylYcFzEzsONl4rftTD//jJBT/mjjQ2ToZTil9NC4trh 23 | xhNS6+wg6xm3gq0jnIrnNxMTxWsQhIYPi2QrTCBDlnNOBfyw9f7LYsakKKTZsPbh 24 | Zw/bAKESzqD6/MMKcgUvm4HLGNRELImLDTnjgYHJAoGAZ3f1VektzDLLfobIKCfB 25 | FlLsLEceCBrnq2OOTIDm39vUa2hB1a+HD4CLbN5azywiwY7vxtJFEDjh5UTdkHLd 26 | rI21jSdJ60isObnQbGmdQMVFYs4qlcDnmJ1miWLPpSTFvYI9swOWOB02Gpaxn7QS 27 | DVQ+oDUCzP6PA1N1hnwF8Mc= 28 | -----END PRIVATE KEY----- 29 | -------------------------------------------------------------------------------- /nginx/zray/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM prooph/nginx:www 2 | 3 | RUN apt-get update \ 4 | && apt-get install -y curl \ 5 | unzip \ 6 | && rm -r /var/lib/apt/lists/* 7 | 8 | # you must also change the version in the path e.g. 0112 9 | ENV ZRAY_VERSION zray-php-104202-php5.6.17-linux-debian7-amd64 10 | 11 | WORKDIR /tmp 12 | 13 | # Z-Ray 14 | RUN curl -L http://downloads.zend.com/zray/1102/${ZRAY_VERSION}.tar.gz | tar zx \ 15 | && mv /tmp/${ZRAY_VERSION}/zray /opt/zray \ 16 | && rm -rf /tmp/${ZRAY_VERSION} \ 17 | # Z-Ray Plugins 18 | && curl -o doctrine2.zip -L https://github.com/sandrokeil/Z-Ray-Doctrine2/archive/master.zip \ 19 | && unzip -o /tmp/doctrine2.zip -d /opt/zray/runtime/var/plugins/ \ 20 | && mv /opt/zray/runtime/var/plugins/Z-Ray-Doctrine2-master /opt/zray/runtime/var/plugins/doctrine2 \ 21 | && chown -R www-data:www-data /opt/zray 22 | 23 | COPY config/ /etc/nginx/ 24 | 25 | WORKDIR /var/www 26 | -------------------------------------------------------------------------------- /nginx/zray/config/sites-enabled/zray.conf: -------------------------------------------------------------------------------- 1 | server { 2 | listen 10081; 3 | listen 10082 ssl http2; 4 | server_name localhost; 5 | server_name_in_redirect off; 6 | root /opt/zray/gui/public; 7 | 8 | index index.php; 9 | 10 | include conf.d/directive-only/x-ua-compatible.conf; 11 | include conf.d/directive-only/ssl.conf; 12 | 13 | location ~ ^/ZendServer/(.+)$ { 14 | add_header "Access-Control-Allow-Origin" "*"; 15 | 16 | try_files /$1 /index.php?$args; 17 | } 18 | 19 | location / { 20 | try_files $uri $uri/ /index.php$is_args$args; 21 | } 22 | 23 | location ~* .php$ { 24 | fastcgi_split_path_info ^(.+\.php)(/.+)$; 25 | fastcgi_pass php:9001; 26 | fastcgi_index index.php; 27 | fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; 28 | include fastcgi_params; 29 | fastcgi_param PATH_INFO $fastcgi_path_info; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /php-cs-test/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM composer as deps 2 | 3 | WORKDIR /tmp/php-cs-fixer 4 | 5 | RUN composer require prooph/php-cs-fixer-config 6 | 7 | FROM php:7.1-cli 8 | 9 | COPY --from=deps /tmp/php-cs-fixer/vendor /usr/local/src/php-cs-fixer 10 | COPY rules.php /rules.php 11 | 12 | VOLUME /app 13 | WORKDIR /app 14 | 15 | CMD ["fix", "--dry-run", "--diff"] 16 | ENTRYPOINT ["/usr/local/src/php-cs-fixer/bin/php-cs-fixer", "--config=/rules.php"] 17 | -------------------------------------------------------------------------------- /php-cs-test/README.md: -------------------------------------------------------------------------------- 1 | # Introduction 2 | 3 | The aim of this container image is to eliminate the need to `php-cs-fixer` in the composer requirements for each project we do. This image can be used on any environment that has Docker installed including a CI pipeline. 4 | 5 | # Usage 6 | 7 | Mount code to `/app` on the container and we will test again prooph's rules. 8 | 9 | ``` 10 | $ docker run --rm -v $(pwd):/app prooph/php-cs-test 11 | ``` 12 | -------------------------------------------------------------------------------- /php-cs-test/rules.php: -------------------------------------------------------------------------------- 1 | getFinder()->in('/app'); 7 | $config->setCacheFile('/tmp/.php_cs.cache'); 8 | 9 | return $config; 10 | -------------------------------------------------------------------------------- /php/README.md: -------------------------------------------------------------------------------- 1 | # PHP Docker files with Alpine Linux 2 | 3 | > These images are only for development environments 4 | 5 | ## PHP Docker Images 6 | 7 | These images are available on [Docker Hub](https://hub.docker.com/r/prooph/php/). 8 | Extends the official PHP image with the following PHP extensions: 9 | 10 | * intl 11 | * mysqli 12 | * pdo_mysql 13 | * pdo_pgsql 14 | * bcmath 15 | * mbstring 16 | * mongodb 17 | * pcntl 18 | * parallel 19 | * amqp 20 | * redis 21 | * soap 22 | * protobuf 23 | * swoole (cli only) 24 | * amqp 25 | * [simdjson](https://github.com/crazyxman/simdjson_php) 26 | 27 | See [prooph/proophessor-do app](https://github.com/prooph/proophessor-do) for an example. 28 | 29 | > Each image has tags for 7.4, 8.0, 8.1 and 8.2 30 | 31 | There are also PHP ZTS versions. 32 | 33 | ## cli 34 | Use the following image: `prooph/php:8.2-cli`. 35 | 36 | ## cli with Opcache 37 | Use the following image: `prooph/php:8.2-cli-opcache`. 38 | 39 | The [PHP Opcache](http://php.net/manual/en/book.opcache.php) is not useful for development, so it's not part of the default PHP-FPM image. Use 40 | this image if you want to have Opcache enabled. 41 | 42 | ## cli with Xdebug 43 | Use the following image: `prooph/php:8.2-cli-xdebug`. 44 | 45 | [Xdebug](http://xdebug.org/) is a PHP debugger. 46 | 47 | > xDebug is already enabled, so you have only to listen for incoming connections in your IDE. Don't forget to set the 48 | path mapping in your IDE with the name *application* ! 49 | 50 | Run the following command with the path to your php file. 51 | 52 | ```bash 53 | $ docker run --rm -it --volume $(pwd):/app -e PHP_IDE_CONFIG="serverName=application" prooph/php:8.2-cli-xdebug php [your file] 54 | ``` 55 | 56 | Mac users doesn't have `docker0` network. According to [networking features](https://docs.docker.com/docker-for-mac/networking/#known-limitations-use-cases-and-workarounds) they should change hostname. 57 | 58 | ```bash 59 | $ docker run --rm -it --volume $(pwd):/app -e PHP_IDE_CONFIG="serverName=application" -e XDEBUG_HOST="docker.for.mac.localhost" prooph/php:8.2-cli-xdebug php [your file] 60 | ``` 61 | 62 | ## cli with SensioLabs Blackfire 63 | Use the following image: `prooph/php:8.2-cli-blackfire`. 64 | 65 | [Blackfire](https://blackfire.io) is a PHP Profiler. No linking with Blackfire-Agent required. 66 | 67 | Run the following command with your [Blackfire](https://blackfire.io/docs/reference-guide/configuration) credentials to profile you cli PHP apps. 68 | 69 | ```bash 70 | $ docker run --rm -it -e BLACKFIRE_SERVER_ID=[YOUR ID] -e BLACKFIRE_SERVER_TOKEN=[YOUR TOKEN] -e BLACKFIRE_CLIENT_ID=[YOUR ID] -e BLACKFIRE_CLIENT_TOKEN=[YOUR TOKEN] --volume $(pwd):/app prooph/php:8.2-cli-blackfire run php [your PHP script] 71 | ``` 72 | 73 | ## fpm 74 | Use the following image: `prooph/php:8.2-fpm`. 75 | 76 | ## fpm with Opcache 77 | Use the following image: `prooph/php:8.2-fpm-opcache`. 78 | 79 | The [PHP Opcache](http://php.net/manual/en/book.opcache.php) is not useful for development, so it's not part of the default PHP-FPM image. Use 80 | this image if you want to have Opcache enabled. 81 | 82 | ## fpm with Xdebug 83 | Use the following image: `prooph/php:8.2-fpm-xdebug`. 84 | 85 | [Xdebug](http://xdebug.org/) is a PHP debugger. 86 | 87 | Configure the Xdebug port in your IDE with `10000` and set the path mappings for the project root folder on server 88 | to `/var/www`. The server name is `localhost`. Don't forget to set the Xdebug cookie in your browser to start debugging. 89 | 90 | ## fpm with Blackfire 91 | Use the following image: `prooph/php:8.2-fpm-blackfire`. 92 | 93 | [SensioLabs Blackfire](https://blackfire.io/) is a PHP Profiler. 94 | 95 | Please refer to the [docs](https://blackfire.io/docs/integrations/docker) to analyze your application. 96 | You need the Blackfire Agent Docker image. 97 | 98 | ## Composer PHP Docker Images 99 | 100 | > If you need Composer 1.x please use the tags with the suffix `-1x` 101 | 102 | These images are available on [Docker Hub](https://hub.docker.com/r/prooph/composer/). 103 | Extends the prooph PHP Docker image and installs Composer `2.x`: 104 | 105 | * zip 106 | * bz2 107 | 108 | To run Composer use: 109 | 110 | ```bash 111 | $ docker run --rm -it --volume $(pwd):/app prooph/composer:7.4 [your composer command] 112 | ``` 113 | 114 | ## Composer with PHP 8.2 115 | Use the following image: `prooph/composer:8.2`. 116 | 117 | ## Composer with PHP 8.1 118 | Use the following image: `prooph/composer:8.1`. 119 | 120 | ## Composer with PHP 8.0 121 | Use the following image: `prooph/composer:8.0`. 122 | 123 | ## Composer with PHP 7.4 124 | Use the following image: `prooph/composer:7.4`. 125 | 126 | ## Composer with PHP ZTS 8.1 127 | Use the following image: `prooph/composer:8.1-zts`. 128 | 129 | ## Composer with PHP ZTS 8.0 130 | Use the following image: `prooph/composer:8.0-zts`. 131 | 132 | ## Composer with PHP ZTS 7.4 133 | Use the following image: `prooph/composer:7.4-zts`. 134 | -------------------------------------------------------------------------------- /php/config/amqp.ini: -------------------------------------------------------------------------------- 1 | extension=amqp.so 2 | -------------------------------------------------------------------------------- /php/config/fpm/php-fpm.conf: -------------------------------------------------------------------------------- 1 | ; This file was initially adapated from the output of: (on PHP 5.6) 2 | ; grep -vE '^;|^ *$' /usr/local/etc/php-fpm.conf.default 3 | 4 | [global] 5 | 6 | error_log = /proc/self/fd/2 7 | daemonize = no 8 | 9 | events.mechanism = epoll 10 | 11 | include = /usr/local/etc/pool.d/*.conf 12 | -------------------------------------------------------------------------------- /php/config/fpm/pool.d/www.conf: -------------------------------------------------------------------------------- 1 | [www] 2 | ; if we send this to /proc/self/fd/1, it never appears 3 | access.log = /proc/self/fd/2 4 | 5 | user = www-data 6 | group = www-data 7 | 8 | listen = [::]:9000 9 | 10 | pm = dynamic 11 | pm.max_children = 5 12 | pm.start_servers = 2 13 | pm.min_spare_servers = 1 14 | pm.max_spare_servers = 3 15 | 16 | clear_env = no 17 | 18 | ; Ensure worker stdout and stderr are sent to the main error log. 19 | catch_workers_output = yes 20 | 21 | ; for debugging 1h 22 | request_terminate_timeout = 3600 23 | 24 | ; allow long plain logging 25 | ;decorate_workers_output = no 26 | ;log_limit = 0 -------------------------------------------------------------------------------- /php/config/mongodb.ini: -------------------------------------------------------------------------------- 1 | extension=mongodb.so 2 | -------------------------------------------------------------------------------- /php/config/opcache.ini: -------------------------------------------------------------------------------- 1 | opcache.memory_consumption=128 2 | opcache.interned_strings_buffer=8 3 | opcache.max_accelerated_files=4000 4 | opcache.revalidate_freq=60 5 | opcache.fast_shutdown=1 6 | opcache.enable_cli=1 7 | opcache.enable=1 8 | -------------------------------------------------------------------------------- /php/config/parallel.ini: -------------------------------------------------------------------------------- 1 | extension=parallel.so 2 | -------------------------------------------------------------------------------- /php/config/php-cli.ini: -------------------------------------------------------------------------------- 1 | ; copy to /usr/local/etc/php/php.ini 2 | 3 | date.timezone = UTC 4 | 5 | memory_limit = -1 6 | 7 | ; for development 8 | error_reporting=E_ALL 9 | display_errors=true 10 | 11 | ; soap 12 | soap.wsdl_cache_enabled=0 13 | -------------------------------------------------------------------------------- /php/config/php.ini: -------------------------------------------------------------------------------- 1 | ; copy to /usr/local/etc/php/php.ini 2 | 3 | date.timezone = UTC 4 | cgi.fix_pathinfo = 1 5 | 6 | ; files 7 | upload_max_filesize=10M 8 | 9 | ; for development 10 | error_reporting=E_ALL 11 | display_errors=true 12 | 13 | ; soap 14 | soap.wsdl_cache_enabled=0 15 | -------------------------------------------------------------------------------- /php/config/php7.ini: -------------------------------------------------------------------------------- 1 | assert.exception=1 2 | zend.assertions=-1 3 | -------------------------------------------------------------------------------- /php/config/protobuf.ini: -------------------------------------------------------------------------------- 1 | extension=protobuf.so -------------------------------------------------------------------------------- /php/config/redis.ini: -------------------------------------------------------------------------------- 1 | extension=redis.so 2 | -------------------------------------------------------------------------------- /php/config/simdjson.ini: -------------------------------------------------------------------------------- 1 | extension=simdjson.so 2 | -------------------------------------------------------------------------------- /php/config/swoole.ini: -------------------------------------------------------------------------------- 1 | extension=swoole.so -------------------------------------------------------------------------------- /php/config/xdebug-cli.ini: -------------------------------------------------------------------------------- 1 | zend_extension=xdebug.so 2 | 3 | xdebug.mode=debug 4 | 5 | xdebug.start_with_request=yes 6 | xdebug.remote_handler=dbgp 7 | ; Dockers network IP, configure it via environment variable XDEBUG_HOST if needed 8 | xdebug.client_host=${XDEBUG_HOST} 9 | 10 | ; display config 11 | xdebug.cli_color=1 12 | xdebug.var_display_max_depth=20 13 | -------------------------------------------------------------------------------- /php/config/xdebug.ini: -------------------------------------------------------------------------------- 1 | zend_extension=xdebug.so 2 | 3 | xdebug.mode=debug 4 | 5 | xdebug.start_with_request=trigger 6 | xdebug.remote_handler=dbgp 7 | xdebug.discover_client_host=yes 8 | ; Dockers network IP, configure it via environment variable XDEBUG_HOST if needed 9 | xdebug.client_host=${XDEBUG_HOST} 10 | -------------------------------------------------------------------------------- /php/docker-compose.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # PHP_TARGET can be cli, fpm or zts 3 | # PHP_VERSION can be any base PHP docker image version e.g. 7.4, 8.0, 8.1 etc. 4 | # DOCKER_REGISTRY is only needed for publishing the Docker images to a registry and can be empty 5 | 6 | services: 7 | php: 8 | image: ${DOCKER_REGISTRY}php:${PHP_VERSION}-${PHP_TARGET} 9 | build: 10 | dockerfile: php-${PHP_TARGET} 11 | target: php-${PHP_TARGET} 12 | args: 13 | PHP_VERSION: ${PHP_VERSION} 14 | 15 | php-blackfire: 16 | image: ${DOCKER_REGISTRY}php:${PHP_VERSION}-${PHP_TARGET}-blackfire 17 | build: 18 | dockerfile: php-${PHP_TARGET} 19 | target: php-${PHP_TARGET}-blackfire 20 | args: 21 | PHP_VERSION: ${PHP_VERSION} 22 | 23 | php-opcache: 24 | image: ${DOCKER_REGISTRY}php:${PHP_VERSION}-${PHP_TARGET}-opcache 25 | build: 26 | dockerfile: php-${PHP_TARGET} 27 | target: php-${PHP_TARGET}-opcache 28 | args: 29 | PHP_VERSION: ${PHP_VERSION} 30 | 31 | php-xdebug: 32 | image: ${DOCKER_REGISTRY}php:${PHP_VERSION}-${PHP_TARGET}-xdebug 33 | build: 34 | dockerfile: php-${PHP_TARGET} 35 | target: php-${PHP_TARGET}-xdebug 36 | args: 37 | PHP_VERSION: ${PHP_VERSION} 38 | 39 | composer: 40 | image: ${DOCKER_REGISTRY}composer:${PHP_VERSION}-${PHP_TARGET} 41 | build: 42 | dockerfile: php-${PHP_TARGET} 43 | target: composer-${PHP_TARGET} 44 | args: 45 | PHP_VERSION: ${PHP_VERSION} 46 | 47 | composer1x: 48 | image: ${DOCKER_REGISTRY}composer:${PHP_VERSION}-${PHP_TARGET}-1x 49 | build: 50 | dockerfile: php-${PHP_TARGET} 51 | target: composer-${PHP_TARGET}-1x 52 | args: 53 | PHP_VERSION: ${PHP_VERSION} 54 | -------------------------------------------------------------------------------- /php/inc/cli-blackfire.m4: -------------------------------------------------------------------------------- 1 | # blackfire CLI (with bundled agent) 2 | RUN set -xeo pipefail \ 3 | && version=$(php -r "echo PHP_MAJOR_VERSION, PHP_MINOR_VERSION;") \ 4 | && curl -sSL -D - -A "Docker" -o /tmp/blackfire-probe.tar.gz https://blackfire.io/api/v1/releases/probe/php/alpine/amd64/${version} \ 5 | && curl -sSL -D - -A "Docker" -o /tmp/blackfire-client.tar.gz https://blackfire.io/api/v1/releases/client/linux_static/amd64 \ 6 | && for file in /tmp/blackfire-*.tar.gz; do tar zxfp "${file}" -C /tmp; done \ 7 | && for file in /tmp/blackfire-*.sha*; do echo "$(cat ${file}) ${file/.sha1/}"; done | sed 's/\.sha/.so/' | sha1sum -c - \ 8 | && chmod +x /tmp/blackfire-*.so /tmp/blackfire \ 9 | && mv /tmp/blackfire-*.so "$(php -r "echo ini_get('extension_dir');")/blackfire.so" \ 10 | && mv /tmp/blackfire /bin/blackfire \ 11 | && printf "extension=blackfire.so\n" > ${PHP_INI_DIR}/conf.d/blackfire.ini \ 12 | && rm -rf /tmp/blackfire* \ 13 | && php -m | grep "^blackfire$" > /dev/null 14 | 15 | ENTRYPOINT ["blackfire"] 16 | CMD ["help"] 17 | -------------------------------------------------------------------------------- /php/inc/cli-xdebug-beta.m4: -------------------------------------------------------------------------------- 1 | # for MAC users 2 | ENV XDEBUG_HOST=172.17.0.1 3 | 4 | include(`xdebug-beta.m4') 5 | 6 | # Copy custom configuration 7 | COPY config/xdebug-cli.ini /usr/local/etc/php/conf.d/ 8 | -------------------------------------------------------------------------------- /php/inc/cli-xdebug.m4: -------------------------------------------------------------------------------- 1 | # for MAC users 2 | ENV XDEBUG_HOST=172.17.0.1 3 | 4 | include(`xdebug.m4') 5 | 6 | # Copy custom configuration 7 | COPY config/xdebug-cli.ini /usr/local/etc/php/conf.d/ 8 | -------------------------------------------------------------------------------- /php/inc/cli.m4: -------------------------------------------------------------------------------- 1 | COPY config/php-cli.ini /usr/local/etc/php/php.ini 2 | 3 | VOLUME ["/app"] 4 | WORKDIR /app -------------------------------------------------------------------------------- /php/inc/composer.m4: -------------------------------------------------------------------------------- 1 | # Environmental Variables 2 | ENV COMPOSER_HOME=/root/composer 3 | ARG COMPOSER_VERSION=1.10.26 4 | ENV COMPOSER_ALLOW_SUPERUSER=1 5 | 6 | RUN set -xe \ 7 | # use own name or other previous .persistent-deps will be removed 8 | && apk add --no-cache --virtual .persistent-deps-composer \ 9 | zlib-dev \ 10 | libzip-dev \ 11 | git \ 12 | unzip \ 13 | openssh-client \ 14 | && docker-php-ext-install \ 15 | zip \ 16 | && curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer --version $COMPOSER_VERSION \ 17 | && composer global require hirak/prestissimo 18 | 19 | # Set up the command arguments 20 | CMD ["-"] 21 | ENTRYPOINT ["composer", "--ansi"] 22 | -------------------------------------------------------------------------------- /php/inc/composer2.m4: -------------------------------------------------------------------------------- 1 | # Environmental Variables 2 | ENV COMPOSER_HOME=/root/composer 3 | ARG COMPOSER_VERSION=2.5.4 4 | ENV COMPOSER_ALLOW_SUPERUSER=1 5 | 6 | RUN set -xe \ 7 | # use own name or other previous .persistent-deps will be removed 8 | && apk add --no-cache --virtual .persistent-deps-composer \ 9 | zlib-dev \ 10 | libzip-dev \ 11 | git \ 12 | unzip \ 13 | openssh-client \ 14 | && docker-php-ext-install \ 15 | zip \ 16 | && curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer --version $COMPOSER_VERSION 17 | 18 | # Set up the command arguments 19 | CMD ["-"] 20 | ENTRYPOINT ["composer", "--ansi"] 21 | -------------------------------------------------------------------------------- /php/inc/fpm-blackfire.m4: -------------------------------------------------------------------------------- 1 | # blackfire HTTP (dedicated agent on blackfire:8707) 2 | RUN set -xeo pipefail \ 3 | && version=$(php -r "echo PHP_MAJOR_VERSION, PHP_MINOR_VERSION;") \ 4 | && curl -sSL -D - -A "Docker" -o /tmp/blackfire-probe.tar.gz https://blackfire.io/api/v1/releases/probe/php/alpine/amd64/${version} \ 5 | && for file in /tmp/blackfire-*.tar.gz; do tar zxfp "${file}" -C /tmp; done \ 6 | && for file in /tmp/blackfire-*.sha*; do echo "$(cat ${file}) ${file/.sha1/}"; done | sed 's/\.sha/.so/' | sha1sum -c - \ 7 | && mv /tmp/blackfire-*.so "$(php -r "echo ini_get('extension_dir');")/blackfire.so" \ 8 | && printf "extension=blackfire.so\nblackfire.agent_socket=tcp://blackfire:8707\n" > ${PHP_INI_DIR}/conf.d/blackfire.ini \ 9 | && rm -rf /tmp/blackfire* \ 10 | && php-fpm -m | grep "^blackfire$" > /dev/null -------------------------------------------------------------------------------- /php/inc/fpm-xdebug-beta.m4: -------------------------------------------------------------------------------- 1 | include(`xdebug-beta.m4') 2 | 3 | # Copy custom configuration 4 | COPY config/xdebug.ini /usr/local/etc/php/conf.d/ 5 | -------------------------------------------------------------------------------- /php/inc/fpm-xdebug.m4: -------------------------------------------------------------------------------- 1 | include(`xdebug.m4') 2 | 3 | # Copy custom configuration 4 | COPY config/xdebug.ini /usr/local/etc/php/conf.d/ 5 | -------------------------------------------------------------------------------- /php/inc/fpm.m4: -------------------------------------------------------------------------------- 1 | # Possible values for ext-name: 2 | # bcmath bz2 calendar ctype curl dba dom enchant exif fileinfo filter ftp gd gettext gmp hash iconv imap interbase intl 3 | # json ldap mbstring mcrypt mssql mysql mysqli oci8 odbc opcache pcntl pdo pdo_dblib pdo_firebird pdo_mysql pdo_oci 4 | # pdo_odbc pdo_pgsql pdo_sqlite pgsql phar posix pspell readline recode reflection session shmop simplexml snmp soap 5 | # sockets spl standard sybase_ct sysvmsg sysvsem sysvshm tidy tokenizer wddx xml xmlreader xmlrpc xmlwriter xsl zip 6 | 7 | COPY config/php7.ini /usr/local/etc/php/conf.d/ 8 | COPY config/fpm/php-fpm.conf /usr/local/etc/ 9 | COPY config/fpm/pool.d /usr/local/etc/pool.d 10 | 11 | VOLUME ["/var/www"] 12 | WORKDIR /var/www -------------------------------------------------------------------------------- /php/inc/macros.m4: -------------------------------------------------------------------------------- 1 | define(`DONT_CHANGE', 2 | `# DO NOT MODIFY THIS AUTOGENERATED FILE 3 | # Change it in m4 folder') -------------------------------------------------------------------------------- /php/inc/opcache.m4: -------------------------------------------------------------------------------- 1 | RUN docker-php-ext-configure opcache --enable-opcache \ 2 | && docker-php-ext-install opcache 3 | 4 | # Copy configuration 5 | COPY config/opcache.ini $PHP_INI_DIR/conf.d/ 6 | -------------------------------------------------------------------------------- /php/inc/php-ext-amqp.m4: -------------------------------------------------------------------------------- 1 | RUN apk add --no-cache --no-progress --virtual .build_deps_php_amqp rabbitmq-c-dev \ 2 | && apk add --no-cache --no-progress rabbitmq-c \ 3 | && apk add --no-cache git autoconf automake gawk build-base \ 4 | && pecl install amqp \ 5 | && apk del .build_deps_php_amqp 6 | 7 | # Copy configuration 8 | COPY config/amqp.ini /usr/local/etc/php/conf.d/ 9 | -------------------------------------------------------------------------------- /php/inc/php-ext-cleanup.m4: -------------------------------------------------------------------------------- 1 | RUN apk del .build-deps \ 2 | && rm -rf /tmp/* \ 3 | && rm -rf /app \ 4 | && mkdir /app -------------------------------------------------------------------------------- /php/inc/php-ext-mongodb.m4: -------------------------------------------------------------------------------- 1 | RUN set -xe \ 2 | && pecl install mongodb 3 | 4 | COPY config/mongodb.ini /usr/local/etc/php/conf.d/ 5 | -------------------------------------------------------------------------------- /php/inc/php-ext-parallel.m4: -------------------------------------------------------------------------------- 1 | RUN set -xe \ 2 | && pecl install parallel 3 | 4 | COPY config/parallel.ini /usr/local/etc/php/conf.d/ 5 | -------------------------------------------------------------------------------- /php/inc/php-ext-protobuff.m4: -------------------------------------------------------------------------------- 1 | # See https://github.com/protocolbuffers/protobuf/tree/main/php 2 | RUN pecl install protobuf 3 | 4 | # Copy configuration 5 | COPY config/protobuf.ini /usr/local/etc/php/conf.d/ 6 | -------------------------------------------------------------------------------- /php/inc/php-ext-redis.m4: -------------------------------------------------------------------------------- 1 | ENV PHP_REDIS_VERSION 5.3.7 2 | 3 | RUN git clone --branch ${PHP_REDIS_VERSION} https://github.com/phpredis/phpredis /tmp/phpredis \ 4 | && cd /tmp/phpredis \ 5 | && phpize \ 6 | && ./configure \ 7 | && make \ 8 | && make install \ 9 | && make test 10 | 11 | # Copy configuration 12 | COPY config/redis.ini /usr/local/etc/php/conf.d/ 13 | -------------------------------------------------------------------------------- /php/inc/php-ext-simdjson.m4: -------------------------------------------------------------------------------- 1 | ENV PHP_SIMDJSON_VERSION master 2 | 3 | # persistent / runtime deps 4 | ENV PHPIZE_DEPS \ 5 | autoconf \ 6 | g++ \ 7 | gcc \ 8 | make \ 9 | pkgconf \ 10 | git \ 11 | re2c 12 | 13 | RUN set -xe \ 14 | && apk add --no-cache --virtual .build-deps \ 15 | $PHPIZE_DEPS \ 16 | && git clone --branch ${PHP_SIMDJSON_VERSION} https://github.com/crazyxman/simdjson_php /tmp/simdjson \ 17 | && cd /tmp/simdjson \ 18 | && phpize \ 19 | && ./configure \ 20 | && make \ 21 | && make install \ 22 | && make test 23 | 24 | # Copy configuration 25 | COPY config/simdjson.ini /usr/local/etc/php/conf.d/ 26 | -------------------------------------------------------------------------------- /php/inc/php-ext-swoole.m4: -------------------------------------------------------------------------------- 1 | RUN set -xe \ 2 | && pecl install swoole 3 | 4 | COPY config/swoole.ini /usr/local/etc/php/conf.d/ 5 | -------------------------------------------------------------------------------- /php/inc/php-ext.m4: -------------------------------------------------------------------------------- 1 | # persistent / runtime deps 2 | ENV PHPIZE_DEPS \ 3 | autoconf \ 4 | cmake \ 5 | file \ 6 | g++ \ 7 | gcc \ 8 | libc-dev \ 9 | pcre-dev \ 10 | make \ 11 | git \ 12 | pkgconf \ 13 | re2c \ 14 | # for GD 15 | freetype-dev \ 16 | libpng-dev \ 17 | libjpeg-turbo-dev \ 18 | # for xslt 19 | libxslt-dev \ 20 | # for intl extension 21 | icu-dev \ 22 | openssl-dev \ 23 | linux-headers 24 | 25 | RUN apk add --no-cache --virtual .persistent-deps \ 26 | # for intl extension 27 | icu-libs \ 28 | # for mongodb 29 | libssl1.1 \ 30 | # for postgres 31 | postgresql-dev \ 32 | # for soap 33 | libxml2-dev \ 34 | # for amqp 35 | libressl-dev \ 36 | # for GD 37 | freetype \ 38 | libpng \ 39 | libjpeg-turbo \ 40 | libxslt \ 41 | # for mbstring 42 | oniguruma-dev \ 43 | libgcrypt 44 | 45 | RUN set -xe \ 46 | # workaround for rabbitmq linking issue 47 | && ln -s /usr/lib /usr/local/lib64 \ 48 | # hack to link libgcrypt 49 | && ln -s /usr/lib/libgcrypt.so.20 /usr/lib/libgcrypt.so \ 50 | && ln -s /usr/lib/libgpg-error.so.0 /usr/lib/libgpg-error.so \ 51 | && apk add --no-cache --virtual .build-deps \ 52 | $PHPIZE_DEPS \ 53 | # 7.4 changes https://github.com/php/php-src/blob/PHP-7.4/UPGRADING 54 | && docker-php-ext-configure gd \ 55 | --enable-gd \ 56 | --with-freetype=/usr/include/ \ 57 | --with-jpeg=/usr/include/ \ 58 | && docker-php-ext-configure bcmath --enable-bcmath \ 59 | && docker-php-ext-configure intl --enable-intl \ 60 | && docker-php-ext-configure pcntl --enable-pcntl \ 61 | && docker-php-ext-configure mysqli --with-mysqli \ 62 | && docker-php-ext-configure pdo_mysql --with-pdo-mysql \ 63 | && docker-php-ext-configure pdo_pgsql --with-pdo-pgsql \ 64 | && docker-php-ext-configure mbstring --enable-mbstring \ 65 | && docker-php-ext-configure soap --enable-soap \ 66 | && docker-php-ext-install -j$(nproc) \ 67 | gd \ 68 | bcmath \ 69 | intl \ 70 | pcntl \ 71 | mysqli \ 72 | pdo_mysql \ 73 | pdo_pgsql \ 74 | mbstring \ 75 | soap \ 76 | xsl 77 | 78 | # Copy configuration 79 | COPY config/php7.ini /usr/local/etc/php/conf.d/ 80 | -------------------------------------------------------------------------------- /php/inc/xdebug-beta.m4: -------------------------------------------------------------------------------- 1 | # persistent / runtime deps 2 | ENV PHPIZE_DEPS \ 3 | autoconf \ 4 | g++ \ 5 | gcc \ 6 | make \ 7 | pkgconf \ 8 | re2c 9 | 10 | RUN set -xe \ 11 | && apk add --no-cache --virtual .build-deps \ 12 | $PHPIZE_DEPS \ 13 | && pecl -d preferred_state=beta install xdebug \ 14 | && apk del .build-deps 15 | -------------------------------------------------------------------------------- /php/inc/xdebug.m4: -------------------------------------------------------------------------------- 1 | # persistent / runtime deps 2 | ENV PHPIZE_DEPS \ 3 | autoconf \ 4 | g++ \ 5 | gcc \ 6 | make \ 7 | pkgconf \ 8 | re2c \ 9 | linux-headers 10 | 11 | RUN set -xe \ 12 | && apk add --no-cache --virtual .build-deps \ 13 | $PHPIZE_DEPS \ 14 | && pecl install xdebug \ 15 | && apk del .build-deps 16 | -------------------------------------------------------------------------------- /php/m4/php-cli.m4: -------------------------------------------------------------------------------- 1 | include(`macros.m4') 2 | DONT_CHANGE() 3 | 4 | ARG ALPINE_VERSION=3.16 5 | ARG PHP_VERSION=8.2 6 | 7 | ######## 8 | # base # 9 | ######## 10 | FROM php:${PHP_VERSION}-cli-alpine${ALPINE_VERSION} as php-cli 11 | 12 | include(`php-ext.m4') 13 | include(`php-ext-mongodb.m4') 14 | include(`php-ext-redis.m4') 15 | include(`php-ext-protobuff.m4') 16 | include(`php-ext-swoole.m4') 17 | include(`php-ext-amqp.m4') 18 | include(`php-ext-simdjson.m4') 19 | include(`php-ext-cleanup.m4') 20 | include(`cli.m4') 21 | 22 | ##################### 23 | # php-cli-blackfire # 24 | ##################### 25 | FROM php-cli as php-cli-blackfire 26 | 27 | include(`cli-blackfire.m4') 28 | 29 | ################### 30 | # php-cli-opcache # 31 | ################### 32 | FROM php-cli as php-cli-opcache 33 | 34 | include(`opcache.m4') 35 | 36 | ################## 37 | # php-cli-xdebug # 38 | ################## 39 | FROM php-cli as php-cli-xdebug 40 | 41 | include(`cli-xdebug.m4') 42 | 43 | ############ 44 | # composer # 45 | ############ 46 | FROM php-cli as composer-cli 47 | 48 | include(`composer2.m4') 49 | 50 | ############## 51 | # composer 1 # 52 | ############## 53 | FROM php-cli as composer-cli-1x 54 | 55 | include(`composer.m4') 56 | -------------------------------------------------------------------------------- /php/m4/php-fpm.m4: -------------------------------------------------------------------------------- 1 | include(`macros.m4') 2 | DONT_CHANGE() 3 | 4 | ARG ALPINE_VERSION=3.16 5 | ARG PHP_VERSION=8.2 6 | 7 | ######## 8 | # base # 9 | ######## 10 | FROM php:${PHP_VERSION}-fpm-alpine${ALPINE_VERSION} as php-fpm 11 | 12 | include(`php-ext.m4') 13 | include(`php-ext-mongodb.m4') 14 | include(`php-ext-redis.m4') 15 | include(`php-ext-protobuff.m4') 16 | include(`php-ext-swoole.m4') 17 | include(`php-ext-amqp.m4') 18 | include(`php-ext-simdjson.m4') 19 | include(`php-ext-cleanup.m4') 20 | include(`fpm.m4') 21 | 22 | ##################### 23 | # php-fpm-blackfire # 24 | ##################### 25 | FROM php-fpm as php-fpm-blackfire 26 | 27 | include(`fpm-blackfire.m4') 28 | 29 | ################### 30 | # php-fpm-opcache # 31 | ################### 32 | FROM php-fpm as php-fpm-opcache 33 | 34 | include(`opcache.m4') 35 | 36 | ##################### 37 | # php-fpm-xdebug # 38 | ##################### 39 | FROM php-fpm as php-fpm-xdebug 40 | 41 | include(`fpm-xdebug.m4') 42 | 43 | ############ 44 | # composer # 45 | ############ 46 | FROM php-fpm as composer-fpm 47 | 48 | include(`composer2.m4') 49 | 50 | ############## 51 | # composer 1 # 52 | ############## 53 | FROM php-fpm as composer-fpm-1x 54 | 55 | include(`composer.m4') 56 | -------------------------------------------------------------------------------- /php/m4/php-zts.m4: -------------------------------------------------------------------------------- 1 | include(`macros.m4') 2 | DONT_CHANGE() 3 | 4 | ARG ALPINE_VERSION=3.16 5 | ARG PHP_VERSION=8.2 6 | 7 | ######## 8 | # base # 9 | ######## 10 | FROM php:${PHP_VERSION}-zts-alpine${ALPINE_VERSION} as php-zts 11 | 12 | include(`php-ext.m4') 13 | include(`php-ext-mongodb.m4') 14 | include(`php-ext-redis.m4') 15 | include(`php-ext-protobuff.m4') 16 | include(`php-ext-swoole.m4') 17 | include(`php-ext-amqp.m4') 18 | include(`php-ext-simdjson.m4') 19 | include(`php-ext-cleanup.m4') 20 | include(`cli.m4') 21 | 22 | ##################### 23 | # php-zts-blackfire # 24 | ##################### 25 | FROM php-zts as php-zts-blackfire 26 | 27 | #include(`cli-blackfire.m4') 28 | 29 | ################### 30 | # php-fpm-opcache # 31 | ################### 32 | FROM php-zts as php-zts-opcache 33 | 34 | include(`opcache.m4') 35 | 36 | ##################### 37 | # php-zts-xdebug # 38 | ##################### 39 | FROM php-zts as php-zts-xdebug 40 | 41 | include(`cli-xdebug.m4') 42 | 43 | ############ 44 | # composer # 45 | ############ 46 | FROM php-zts as composer-zts 47 | 48 | include(`composer2.m4') 49 | 50 | ############## 51 | # composer 1 # 52 | ############## 53 | FROM php-zts as composer-zts-1x 54 | 55 | include(`composer.m4') 56 | -------------------------------------------------------------------------------- /php/makefile: -------------------------------------------------------------------------------- 1 | CPUS:=$(shell grep -c ^processor /proc/cpuinfo) 2 | MAKEFLAGS += --jobs=$(CPUS) 3 | 4 | LIST:= $(sort $(wildcard m4/*.m4)) 5 | dir:=./ 6 | EXCLUDE_LIST:= %-xdebug.m4 %-opcache.m4 %-blackfire.m4 7 | 8 | dockerfiles: 9 | for i in $(LIST); do \ 10 | m4 -I $(dir)/inc $(dir)"$$i" | awk 'NF' > `echo $${i##*/} | sed "s/.m4//"` ; \ 11 | done 12 | 13 | docker-build: 14 | export PHP_VERSION=8.0; export PHP_TARGET=cli; export DOCKER_REGISTRY=prooph/; docker-compose build 15 | export PHP_VERSION=8.1; export PHP_TARGET=cli; export DOCKER_REGISTRY=prooph/; docker-compose build 16 | export PHP_VERSION=8.2; export PHP_TARGET=cli; export DOCKER_REGISTRY=prooph/; docker-compose build 17 | 18 | export PHP_VERSION=8.0; export PHP_TARGET=fpm; export DOCKER_REGISTRY=prooph/; docker-compose build 19 | export PHP_VERSION=8.1; export PHP_TARGET=fpm; export DOCKER_REGISTRY=prooph/; docker-compose build 20 | export PHP_VERSION=8.2; export PHP_TARGET=fpm; export DOCKER_REGISTRY=prooph/; docker-compose build 21 | 22 | export PHP_VERSION=8.0; export PHP_TARGET=zts; export DOCKER_REGISTRY=prooph/; docker-compose build 23 | export PHP_VERSION=8.1; export PHP_TARGET=zts; export DOCKER_REGISTRY=prooph/; docker-compose build 24 | export PHP_VERSION=8.2; export PHP_TARGET=zts; export DOCKER_REGISTRY=prooph/; docker-compose build 25 | 26 | docker-push: 27 | export PHP_VERSION=8.0; export PHP_TARGET=cli; export DOCKER_REGISTRY=prooph/; docker-compose push 28 | export PHP_VERSION=8.1; export PHP_TARGET=cli; export DOCKER_REGISTRY=prooph/; docker-compose push 29 | export PHP_VERSION=8.2; export PHP_TARGET=cli; export DOCKER_REGISTRY=prooph/; docker-compose push 30 | 31 | export PHP_VERSION=8.0; export PHP_TARGET=fpm; export DOCKER_REGISTRY=prooph/; docker-compose push 32 | export PHP_VERSION=8.1; export PHP_TARGET=fpm; export DOCKER_REGISTRY=prooph/; docker-compose push 33 | export PHP_VERSION=8.2; export PHP_TARGET=fpm; export DOCKER_REGISTRY=prooph/; docker-compose push 34 | 35 | export PHP_VERSION=8.0; export PHP_TARGET=zts; export DOCKER_REGISTRY=prooph/; docker-compose push 36 | export PHP_VERSION=8.1; export PHP_TARGET=zts; export DOCKER_REGISTRY=prooph/; docker-compose push 37 | export PHP_VERSION=8.2; export PHP_TARGET=zts; export DOCKER_REGISTRY=prooph/; docker-compose push 38 | 39 | docker-pull: 40 | docker pull php:8.0-cli-alpine3.16 41 | docker pull php:8.1-cli-alpine3.16 42 | docker pull php:8.0-fpm-alpine3.16 43 | docker pull php:8.1-fpm-alpine3.16 44 | docker pull php:8.2-fpm-alpine3.16 45 | docker pull php:8.0-zts-alpine3.16 46 | docker pull php:8.1-zts-alpine3.16 47 | docker pull php:8.2-zts-alpine3.16 48 | -------------------------------------------------------------------------------- /php/php-cli: -------------------------------------------------------------------------------- 1 | # DO NOT MODIFY THIS AUTOGENERATED FILE 2 | # Change it in m4 folder 3 | ARG ALPINE_VERSION=3.16 4 | ARG PHP_VERSION=8.2 5 | ######## 6 | # base # 7 | ######## 8 | FROM php:${PHP_VERSION}-cli-alpine${ALPINE_VERSION} as php-cli 9 | # persistent / runtime deps 10 | ENV PHPIZE_DEPS \ 11 | autoconf \ 12 | cmake \ 13 | file \ 14 | g++ \ 15 | gcc \ 16 | libc-dev \ 17 | pcre-dev \ 18 | make \ 19 | git \ 20 | pkgconf \ 21 | re2c \ 22 | # for GD 23 | freetype-dev \ 24 | libpng-dev \ 25 | libjpeg-turbo-dev \ 26 | # for xslt 27 | libxslt-dev \ 28 | # for intl extension 29 | icu-dev \ 30 | openssl-dev \ 31 | linux-headers 32 | RUN apk add --no-cache --virtual .persistent-deps \ 33 | # for intl extension 34 | icu-libs \ 35 | # for mongodb 36 | libssl1.1 \ 37 | # for postgres 38 | postgresql-dev \ 39 | # for soap 40 | libxml2-dev \ 41 | # for amqp 42 | libressl-dev \ 43 | # for GD 44 | freetype \ 45 | libpng \ 46 | libjpeg-turbo \ 47 | libxslt \ 48 | # for mbstring 49 | oniguruma-dev \ 50 | libgcrypt 51 | RUN set -xe \ 52 | # workaround for rabbitmq linking issue 53 | && ln -s /usr/lib /usr/local/lib64 \ 54 | # hack to link libgcrypt 55 | && ln -s /usr/lib/libgcrypt.so.20 /usr/lib/libgcrypt.so \ 56 | && ln -s /usr/lib/libgpg-error.so.0 /usr/lib/libgpg-error.so \ 57 | && apk add --no-cache --virtual .build-deps \ 58 | $PHPIZE_DEPS \ 59 | # 7.4 changes https://github.com/php/php-src/blob/PHP-7.4/UPGRADING 60 | && docker-php-ext-configure gd \ 61 | --enable-gd \ 62 | --with-freetype=/usr/include/ \ 63 | --with-jpeg=/usr/include/ \ 64 | && docker-php-ext-configure bcmath --enable-bcmath \ 65 | && docker-php-ext-configure intl --enable-intl \ 66 | && docker-php-ext-configure pcntl --enable-pcntl \ 67 | && docker-php-ext-configure mysqli --with-mysqli \ 68 | && docker-php-ext-configure pdo_mysql --with-pdo-mysql \ 69 | && docker-php-ext-configure pdo_pgsql --with-pdo-pgsql \ 70 | && docker-php-ext-configure mbstring --enable-mbstring \ 71 | && docker-php-ext-configure soap --enable-soap \ 72 | && docker-php-ext-install -j$(nproc) \ 73 | gd \ 74 | bcmath \ 75 | intl \ 76 | pcntl \ 77 | mysqli \ 78 | pdo_mysql \ 79 | pdo_pgsql \ 80 | mbstring \ 81 | soap \ 82 | xsl 83 | # Copy configuration 84 | COPY config/php7.ini /usr/local/etc/php/conf.d/ 85 | RUN set -xe \ 86 | && pecl install mongodb 87 | COPY config/mongodb.ini /usr/local/etc/php/conf.d/ 88 | ENV PHP_REDIS_VERSION 5.3.7 89 | RUN git clone --branch ${PHP_REDIS_VERSION} https://github.com/phpredis/phpredis /tmp/phpredis \ 90 | && cd /tmp/phpredis \ 91 | && phpize \ 92 | && ./configure \ 93 | && make \ 94 | && make install \ 95 | && make test 96 | # Copy configuration 97 | COPY config/redis.ini /usr/local/etc/php/conf.d/ 98 | # See https://github.com/protocolbuffers/protobuf/tree/main/php 99 | RUN pecl install protobuf 100 | # Copy configuration 101 | COPY config/protobuf.ini /usr/local/etc/php/conf.d/ 102 | RUN set -xe \ 103 | && pecl install swoole 104 | COPY config/swoole.ini /usr/local/etc/php/conf.d/ 105 | RUN apk add --no-cache --no-progress --virtual .build_deps_php_amqp rabbitmq-c-dev \ 106 | && apk add --no-cache --no-progress rabbitmq-c \ 107 | && apk add --no-cache git autoconf automake gawk build-base \ 108 | && pecl install amqp \ 109 | && apk del .build_deps_php_amqp 110 | # Copy configuration 111 | COPY config/amqp.ini /usr/local/etc/php/conf.d/ 112 | ENV PHP_SIMDJSON_VERSION master 113 | # persistent / runtime deps 114 | ENV PHPIZE_DEPS \ 115 | autoconf \ 116 | g++ \ 117 | gcc \ 118 | make \ 119 | pkgconf \ 120 | git \ 121 | re2c 122 | RUN set -xe \ 123 | && apk add --no-cache --virtual .build-deps \ 124 | $PHPIZE_DEPS \ 125 | && git clone --branch ${PHP_SIMDJSON_VERSION} https://github.com/crazyxman/simdjson_php /tmp/simdjson \ 126 | && cd /tmp/simdjson \ 127 | && phpize \ 128 | && ./configure \ 129 | && make \ 130 | && make install \ 131 | && make test 132 | # Copy configuration 133 | COPY config/simdjson.ini /usr/local/etc/php/conf.d/ 134 | RUN apk del .build-deps \ 135 | && rm -rf /tmp/* \ 136 | && rm -rf /app \ 137 | && mkdir /app 138 | COPY config/php-cli.ini /usr/local/etc/php/php.ini 139 | VOLUME ["/app"] 140 | WORKDIR /app 141 | ##################### 142 | # php-cli-blackfire # 143 | ##################### 144 | FROM php-cli as php-cli-blackfire 145 | # blackfire CLI (with bundled agent) 146 | RUN set -xeo pipefail \ 147 | && version=$(php -r "echo PHP_MAJOR_VERSION, PHP_MINOR_VERSION;") \ 148 | && curl -sSL -D - -A "Docker" -o /tmp/blackfire-probe.tar.gz https://blackfire.io/api/v1/releases/probe/php/alpine/amd64/${version} \ 149 | && curl -sSL -D - -A "Docker" -o /tmp/blackfire-client.tar.gz https://blackfire.io/api/v1/releases/client/linux_static/amd64 \ 150 | && for file in /tmp/blackfire-*.tar.gz; do tar zxfp "${file}" -C /tmp; done \ 151 | && for file in /tmp/blackfire-*.sha*; do echo "$(cat ${file}) ${file/.sha1/}"; done | sed 's/\.sha/.so/' | sha1sum -c - \ 152 | && chmod +x /tmp/blackfire-*.so /tmp/blackfire \ 153 | && mv /tmp/blackfire-*.so "$(php -r "echo ini_get('extension_dir');")/blackfire.so" \ 154 | && mv /tmp/blackfire /bin/blackfire \ 155 | && printf "extension=blackfire.so\n" > ${PHP_INI_DIR}/conf.d/blackfire.ini \ 156 | && rm -rf /tmp/blackfire* \ 157 | && php -m | grep "^blackfire$" > /dev/null 158 | ENTRYPOINT ["blackfire"] 159 | CMD ["help"] 160 | ################### 161 | # php-cli-opcache # 162 | ################### 163 | FROM php-cli as php-cli-opcache 164 | RUN docker-php-ext-configure opcache --enable-opcache \ 165 | && docker-php-ext-install opcache 166 | # Copy configuration 167 | COPY config/opcache.ini $PHP_INI_DIR/conf.d/ 168 | ################## 169 | # php-cli-xdebug # 170 | ################## 171 | FROM php-cli as php-cli-xdebug 172 | # for MAC users 173 | ENV XDEBUG_HOST=172.17.0.1 174 | # persistent / runtime deps 175 | ENV PHPIZE_DEPS \ 176 | autoconf \ 177 | g++ \ 178 | gcc \ 179 | make \ 180 | pkgconf \ 181 | re2c \ 182 | linux-headers 183 | RUN set -xe \ 184 | && apk add --no-cache --virtual .build-deps \ 185 | $PHPIZE_DEPS \ 186 | && pecl install xdebug \ 187 | && apk del .build-deps 188 | # Copy custom configuration 189 | COPY config/xdebug-cli.ini /usr/local/etc/php/conf.d/ 190 | ############ 191 | # composer # 192 | ############ 193 | FROM php-cli as composer-cli 194 | # Environmental Variables 195 | ENV COMPOSER_HOME=/root/composer 196 | ARG COMPOSER_VERSION=2.5.4 197 | ENV COMPOSER_ALLOW_SUPERUSER=1 198 | RUN set -xe \ 199 | # use own name or other previous .persistent-deps will be removed 200 | && apk add --no-cache --virtual .persistent-deps-composer \ 201 | zlib-dev \ 202 | libzip-dev \ 203 | git \ 204 | unzip \ 205 | openssh-client \ 206 | && docker-php-ext-install \ 207 | zip \ 208 | && curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer --version $COMPOSER_VERSION 209 | # Set up the command arguments 210 | CMD ["-"] 211 | ENTRYPOINT ["composer", "--ansi"] 212 | ############## 213 | # composer 1 # 214 | ############## 215 | FROM php-cli as composer-cli-1x 216 | # Environmental Variables 217 | ENV COMPOSER_HOME=/root/composer 218 | ARG COMPOSER_VERSION=1.10.26 219 | ENV COMPOSER_ALLOW_SUPERUSER=1 220 | RUN set -xe \ 221 | # use own name or other previous .persistent-deps will be removed 222 | && apk add --no-cache --virtual .persistent-deps-composer \ 223 | zlib-dev \ 224 | libzip-dev \ 225 | git \ 226 | unzip \ 227 | openssh-client \ 228 | && docker-php-ext-install \ 229 | zip \ 230 | && curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer --version $COMPOSER_VERSION \ 231 | && composer global require hirak/prestissimo 232 | # Set up the command arguments 233 | CMD ["-"] 234 | ENTRYPOINT ["composer", "--ansi"] 235 | -------------------------------------------------------------------------------- /php/php-fpm: -------------------------------------------------------------------------------- 1 | # DO NOT MODIFY THIS AUTOGENERATED FILE 2 | # Change it in m4 folder 3 | ARG ALPINE_VERSION=3.16 4 | ARG PHP_VERSION=8.2 5 | ######## 6 | # base # 7 | ######## 8 | FROM php:${PHP_VERSION}-fpm-alpine${ALPINE_VERSION} as php-fpm 9 | # persistent / runtime deps 10 | ENV PHPIZE_DEPS \ 11 | autoconf \ 12 | cmake \ 13 | file \ 14 | g++ \ 15 | gcc \ 16 | libc-dev \ 17 | pcre-dev \ 18 | make \ 19 | git \ 20 | pkgconf \ 21 | re2c \ 22 | # for GD 23 | freetype-dev \ 24 | libpng-dev \ 25 | libjpeg-turbo-dev \ 26 | # for xslt 27 | libxslt-dev \ 28 | # for intl extension 29 | icu-dev \ 30 | openssl-dev \ 31 | linux-headers 32 | RUN apk add --no-cache --virtual .persistent-deps \ 33 | # for intl extension 34 | icu-libs \ 35 | # for mongodb 36 | libssl1.1 \ 37 | # for postgres 38 | postgresql-dev \ 39 | # for soap 40 | libxml2-dev \ 41 | # for amqp 42 | libressl-dev \ 43 | # for GD 44 | freetype \ 45 | libpng \ 46 | libjpeg-turbo \ 47 | libxslt \ 48 | # for mbstring 49 | oniguruma-dev \ 50 | libgcrypt 51 | RUN set -xe \ 52 | # workaround for rabbitmq linking issue 53 | && ln -s /usr/lib /usr/local/lib64 \ 54 | # hack to link libgcrypt 55 | && ln -s /usr/lib/libgcrypt.so.20 /usr/lib/libgcrypt.so \ 56 | && ln -s /usr/lib/libgpg-error.so.0 /usr/lib/libgpg-error.so \ 57 | && apk add --no-cache --virtual .build-deps \ 58 | $PHPIZE_DEPS \ 59 | # 7.4 changes https://github.com/php/php-src/blob/PHP-7.4/UPGRADING 60 | && docker-php-ext-configure gd \ 61 | --enable-gd \ 62 | --with-freetype=/usr/include/ \ 63 | --with-jpeg=/usr/include/ \ 64 | && docker-php-ext-configure bcmath --enable-bcmath \ 65 | && docker-php-ext-configure intl --enable-intl \ 66 | && docker-php-ext-configure pcntl --enable-pcntl \ 67 | && docker-php-ext-configure mysqli --with-mysqli \ 68 | && docker-php-ext-configure pdo_mysql --with-pdo-mysql \ 69 | && docker-php-ext-configure pdo_pgsql --with-pdo-pgsql \ 70 | && docker-php-ext-configure mbstring --enable-mbstring \ 71 | && docker-php-ext-configure soap --enable-soap \ 72 | && docker-php-ext-install -j$(nproc) \ 73 | gd \ 74 | bcmath \ 75 | intl \ 76 | pcntl \ 77 | mysqli \ 78 | pdo_mysql \ 79 | pdo_pgsql \ 80 | mbstring \ 81 | soap \ 82 | xsl 83 | # Copy configuration 84 | COPY config/php7.ini /usr/local/etc/php/conf.d/ 85 | RUN set -xe \ 86 | && pecl install mongodb 87 | COPY config/mongodb.ini /usr/local/etc/php/conf.d/ 88 | ENV PHP_REDIS_VERSION 5.3.7 89 | RUN git clone --branch ${PHP_REDIS_VERSION} https://github.com/phpredis/phpredis /tmp/phpredis \ 90 | && cd /tmp/phpredis \ 91 | && phpize \ 92 | && ./configure \ 93 | && make \ 94 | && make install \ 95 | && make test 96 | # Copy configuration 97 | COPY config/redis.ini /usr/local/etc/php/conf.d/ 98 | # See https://github.com/protocolbuffers/protobuf/tree/main/php 99 | RUN pecl install protobuf 100 | # Copy configuration 101 | COPY config/protobuf.ini /usr/local/etc/php/conf.d/ 102 | RUN set -xe \ 103 | && pecl install swoole 104 | COPY config/swoole.ini /usr/local/etc/php/conf.d/ 105 | RUN apk add --no-cache --no-progress --virtual .build_deps_php_amqp rabbitmq-c-dev \ 106 | && apk add --no-cache --no-progress rabbitmq-c \ 107 | && apk add --no-cache git autoconf automake gawk build-base \ 108 | && pecl install amqp \ 109 | && apk del .build_deps_php_amqp 110 | # Copy configuration 111 | COPY config/amqp.ini /usr/local/etc/php/conf.d/ 112 | ENV PHP_SIMDJSON_VERSION master 113 | # persistent / runtime deps 114 | ENV PHPIZE_DEPS \ 115 | autoconf \ 116 | g++ \ 117 | gcc \ 118 | make \ 119 | pkgconf \ 120 | git \ 121 | re2c 122 | RUN set -xe \ 123 | && apk add --no-cache --virtual .build-deps \ 124 | $PHPIZE_DEPS \ 125 | && git clone --branch ${PHP_SIMDJSON_VERSION} https://github.com/crazyxman/simdjson_php /tmp/simdjson \ 126 | && cd /tmp/simdjson \ 127 | && phpize \ 128 | && ./configure \ 129 | && make \ 130 | && make install \ 131 | && make test 132 | # Copy configuration 133 | COPY config/simdjson.ini /usr/local/etc/php/conf.d/ 134 | RUN apk del .build-deps \ 135 | && rm -rf /tmp/* \ 136 | && rm -rf /app \ 137 | && mkdir /app 138 | # Possible values for ext-name: 139 | # bcmath bz2 calendar ctype curl dba dom enchant exif fileinfo filter ftp gd gettext gmp hash iconv imap interbase intl 140 | # json ldap mbstring mcrypt mssql mysql mysqli oci8 odbc opcache pcntl pdo pdo_dblib pdo_firebird pdo_mysql pdo_oci 141 | # pdo_odbc pdo_pgsql pdo_sqlite pgsql phar posix pspell readline recode reflection session shmop simplexml snmp soap 142 | # sockets spl standard sybase_ct sysvmsg sysvsem sysvshm tidy tokenizer wddx xml xmlreader xmlrpc xmlwriter xsl zip 143 | COPY config/php7.ini /usr/local/etc/php/conf.d/ 144 | COPY config/fpm/php-fpm.conf /usr/local/etc/ 145 | COPY config/fpm/pool.d /usr/local/etc/pool.d 146 | VOLUME ["/var/www"] 147 | WORKDIR /var/www 148 | ##################### 149 | # php-fpm-blackfire # 150 | ##################### 151 | FROM php-fpm as php-fpm-blackfire 152 | # blackfire HTTP (dedicated agent on blackfire:8707) 153 | RUN set -xeo pipefail \ 154 | && version=$(php -r "echo PHP_MAJOR_VERSION, PHP_MINOR_VERSION;") \ 155 | && curl -sSL -D - -A "Docker" -o /tmp/blackfire-probe.tar.gz https://blackfire.io/api/v1/releases/probe/php/alpine/amd64/${version} \ 156 | && for file in /tmp/blackfire-*.tar.gz; do tar zxfp "${file}" -C /tmp; done \ 157 | && for file in /tmp/blackfire-*.sha*; do echo "$(cat ${file}) ${file/.sha1/}"; done | sed 's/\.sha/.so/' | sha1sum -c - \ 158 | && mv /tmp/blackfire-*.so "$(php -r "echo ini_get('extension_dir');")/blackfire.so" \ 159 | && printf "extension=blackfire.so\nblackfire.agent_socket=tcp://blackfire:8707\n" > ${PHP_INI_DIR}/conf.d/blackfire.ini \ 160 | && rm -rf /tmp/blackfire* \ 161 | && php-fpm -m | grep "^blackfire$" > /dev/null 162 | ################### 163 | # php-fpm-opcache # 164 | ################### 165 | FROM php-fpm as php-fpm-opcache 166 | RUN docker-php-ext-configure opcache --enable-opcache \ 167 | && docker-php-ext-install opcache 168 | # Copy configuration 169 | COPY config/opcache.ini $PHP_INI_DIR/conf.d/ 170 | ##################### 171 | # php-fpm-xdebug # 172 | ##################### 173 | FROM php-fpm as php-fpm-xdebug 174 | # persistent / runtime deps 175 | ENV PHPIZE_DEPS \ 176 | autoconf \ 177 | g++ \ 178 | gcc \ 179 | make \ 180 | pkgconf \ 181 | re2c \ 182 | linux-headers 183 | RUN set -xe \ 184 | && apk add --no-cache --virtual .build-deps \ 185 | $PHPIZE_DEPS \ 186 | && pecl install xdebug \ 187 | && apk del .build-deps 188 | # Copy custom configuration 189 | COPY config/xdebug.ini /usr/local/etc/php/conf.d/ 190 | ############ 191 | # composer # 192 | ############ 193 | FROM php-fpm as composer-fpm 194 | # Environmental Variables 195 | ENV COMPOSER_HOME=/root/composer 196 | ARG COMPOSER_VERSION=2.5.4 197 | ENV COMPOSER_ALLOW_SUPERUSER=1 198 | RUN set -xe \ 199 | # use own name or other previous .persistent-deps will be removed 200 | && apk add --no-cache --virtual .persistent-deps-composer \ 201 | zlib-dev \ 202 | libzip-dev \ 203 | git \ 204 | unzip \ 205 | openssh-client \ 206 | && docker-php-ext-install \ 207 | zip \ 208 | && curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer --version $COMPOSER_VERSION 209 | # Set up the command arguments 210 | CMD ["-"] 211 | ENTRYPOINT ["composer", "--ansi"] 212 | ############## 213 | # composer 1 # 214 | ############## 215 | FROM php-fpm as composer-fpm-1x 216 | # Environmental Variables 217 | ENV COMPOSER_HOME=/root/composer 218 | ARG COMPOSER_VERSION=1.10.26 219 | ENV COMPOSER_ALLOW_SUPERUSER=1 220 | RUN set -xe \ 221 | # use own name or other previous .persistent-deps will be removed 222 | && apk add --no-cache --virtual .persistent-deps-composer \ 223 | zlib-dev \ 224 | libzip-dev \ 225 | git \ 226 | unzip \ 227 | openssh-client \ 228 | && docker-php-ext-install \ 229 | zip \ 230 | && curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer --version $COMPOSER_VERSION \ 231 | && composer global require hirak/prestissimo 232 | # Set up the command arguments 233 | CMD ["-"] 234 | ENTRYPOINT ["composer", "--ansi"] 235 | -------------------------------------------------------------------------------- /php/php-zts: -------------------------------------------------------------------------------- 1 | # DO NOT MODIFY THIS AUTOGENERATED FILE 2 | # Change it in m4 folder 3 | ARG ALPINE_VERSION=3.16 4 | ARG PHP_VERSION=8.2 5 | ######## 6 | # base # 7 | ######## 8 | FROM php:${PHP_VERSION}-zts-alpine${ALPINE_VERSION} as php-zts 9 | # persistent / runtime deps 10 | ENV PHPIZE_DEPS \ 11 | autoconf \ 12 | cmake \ 13 | file \ 14 | g++ \ 15 | gcc \ 16 | libc-dev \ 17 | pcre-dev \ 18 | make \ 19 | git \ 20 | pkgconf \ 21 | re2c \ 22 | # for GD 23 | freetype-dev \ 24 | libpng-dev \ 25 | libjpeg-turbo-dev \ 26 | # for xslt 27 | libxslt-dev \ 28 | # for intl extension 29 | icu-dev \ 30 | openssl-dev \ 31 | linux-headers 32 | RUN apk add --no-cache --virtual .persistent-deps \ 33 | # for intl extension 34 | icu-libs \ 35 | # for mongodb 36 | libssl1.1 \ 37 | # for postgres 38 | postgresql-dev \ 39 | # for soap 40 | libxml2-dev \ 41 | # for amqp 42 | libressl-dev \ 43 | # for GD 44 | freetype \ 45 | libpng \ 46 | libjpeg-turbo \ 47 | libxslt \ 48 | # for mbstring 49 | oniguruma-dev \ 50 | libgcrypt 51 | RUN set -xe \ 52 | # workaround for rabbitmq linking issue 53 | && ln -s /usr/lib /usr/local/lib64 \ 54 | # hack to link libgcrypt 55 | && ln -s /usr/lib/libgcrypt.so.20 /usr/lib/libgcrypt.so \ 56 | && ln -s /usr/lib/libgpg-error.so.0 /usr/lib/libgpg-error.so \ 57 | && apk add --no-cache --virtual .build-deps \ 58 | $PHPIZE_DEPS \ 59 | # 7.4 changes https://github.com/php/php-src/blob/PHP-7.4/UPGRADING 60 | && docker-php-ext-configure gd \ 61 | --enable-gd \ 62 | --with-freetype=/usr/include/ \ 63 | --with-jpeg=/usr/include/ \ 64 | && docker-php-ext-configure bcmath --enable-bcmath \ 65 | && docker-php-ext-configure intl --enable-intl \ 66 | && docker-php-ext-configure pcntl --enable-pcntl \ 67 | && docker-php-ext-configure mysqli --with-mysqli \ 68 | && docker-php-ext-configure pdo_mysql --with-pdo-mysql \ 69 | && docker-php-ext-configure pdo_pgsql --with-pdo-pgsql \ 70 | && docker-php-ext-configure mbstring --enable-mbstring \ 71 | && docker-php-ext-configure soap --enable-soap \ 72 | && docker-php-ext-install -j$(nproc) \ 73 | gd \ 74 | bcmath \ 75 | intl \ 76 | pcntl \ 77 | mysqli \ 78 | pdo_mysql \ 79 | pdo_pgsql \ 80 | mbstring \ 81 | soap \ 82 | xsl 83 | # Copy configuration 84 | COPY config/php7.ini /usr/local/etc/php/conf.d/ 85 | RUN set -xe \ 86 | && pecl install mongodb 87 | COPY config/mongodb.ini /usr/local/etc/php/conf.d/ 88 | ENV PHP_REDIS_VERSION 5.3.7 89 | RUN git clone --branch ${PHP_REDIS_VERSION} https://github.com/phpredis/phpredis /tmp/phpredis \ 90 | && cd /tmp/phpredis \ 91 | && phpize \ 92 | && ./configure \ 93 | && make \ 94 | && make install \ 95 | && make test 96 | # Copy configuration 97 | COPY config/redis.ini /usr/local/etc/php/conf.d/ 98 | # See https://github.com/protocolbuffers/protobuf/tree/main/php 99 | RUN pecl install protobuf 100 | # Copy configuration 101 | COPY config/protobuf.ini /usr/local/etc/php/conf.d/ 102 | RUN set -xe \ 103 | && pecl install swoole 104 | COPY config/swoole.ini /usr/local/etc/php/conf.d/ 105 | RUN apk add --no-cache --no-progress --virtual .build_deps_php_amqp rabbitmq-c-dev \ 106 | && apk add --no-cache --no-progress rabbitmq-c \ 107 | && apk add --no-cache git autoconf automake gawk build-base \ 108 | && pecl install amqp \ 109 | && apk del .build_deps_php_amqp 110 | # Copy configuration 111 | COPY config/amqp.ini /usr/local/etc/php/conf.d/ 112 | ENV PHP_SIMDJSON_VERSION master 113 | # persistent / runtime deps 114 | ENV PHPIZE_DEPS \ 115 | autoconf \ 116 | g++ \ 117 | gcc \ 118 | make \ 119 | pkgconf \ 120 | git \ 121 | re2c 122 | RUN set -xe \ 123 | && apk add --no-cache --virtual .build-deps \ 124 | $PHPIZE_DEPS \ 125 | && git clone --branch ${PHP_SIMDJSON_VERSION} https://github.com/crazyxman/simdjson_php /tmp/simdjson \ 126 | && cd /tmp/simdjson \ 127 | && phpize \ 128 | && ./configure \ 129 | && make \ 130 | && make install \ 131 | && make test 132 | # Copy configuration 133 | COPY config/simdjson.ini /usr/local/etc/php/conf.d/ 134 | RUN apk del .build-deps \ 135 | && rm -rf /tmp/* \ 136 | && rm -rf /app \ 137 | && mkdir /app 138 | COPY config/php-cli.ini /usr/local/etc/php/php.ini 139 | VOLUME ["/app"] 140 | WORKDIR /app 141 | ##################### 142 | # php-zts-blackfire # 143 | ##################### 144 | FROM php-zts as php-zts-blackfire 145 | #include(`cli-blackfire.m4') 146 | ################### 147 | # php-fpm-opcache # 148 | ################### 149 | FROM php-zts as php-zts-opcache 150 | RUN docker-php-ext-configure opcache --enable-opcache \ 151 | && docker-php-ext-install opcache 152 | # Copy configuration 153 | COPY config/opcache.ini $PHP_INI_DIR/conf.d/ 154 | ##################### 155 | # php-zts-xdebug # 156 | ##################### 157 | FROM php-zts as php-zts-xdebug 158 | # for MAC users 159 | ENV XDEBUG_HOST=172.17.0.1 160 | # persistent / runtime deps 161 | ENV PHPIZE_DEPS \ 162 | autoconf \ 163 | g++ \ 164 | gcc \ 165 | make \ 166 | pkgconf \ 167 | re2c \ 168 | linux-headers 169 | RUN set -xe \ 170 | && apk add --no-cache --virtual .build-deps \ 171 | $PHPIZE_DEPS \ 172 | && pecl install xdebug \ 173 | && apk del .build-deps 174 | # Copy custom configuration 175 | COPY config/xdebug-cli.ini /usr/local/etc/php/conf.d/ 176 | ############ 177 | # composer # 178 | ############ 179 | FROM php-zts as composer-zts 180 | # Environmental Variables 181 | ENV COMPOSER_HOME=/root/composer 182 | ARG COMPOSER_VERSION=2.5.4 183 | ENV COMPOSER_ALLOW_SUPERUSER=1 184 | RUN set -xe \ 185 | # use own name or other previous .persistent-deps will be removed 186 | && apk add --no-cache --virtual .persistent-deps-composer \ 187 | zlib-dev \ 188 | libzip-dev \ 189 | git \ 190 | unzip \ 191 | openssh-client \ 192 | && docker-php-ext-install \ 193 | zip \ 194 | && curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer --version $COMPOSER_VERSION 195 | # Set up the command arguments 196 | CMD ["-"] 197 | ENTRYPOINT ["composer", "--ansi"] 198 | ############## 199 | # composer 1 # 200 | ############## 201 | FROM php-zts as composer-zts-1x 202 | # Environmental Variables 203 | ENV COMPOSER_HOME=/root/composer 204 | ARG COMPOSER_VERSION=1.10.26 205 | ENV COMPOSER_ALLOW_SUPERUSER=1 206 | RUN set -xe \ 207 | # use own name or other previous .persistent-deps will be removed 208 | && apk add --no-cache --virtual .persistent-deps-composer \ 209 | zlib-dev \ 210 | libzip-dev \ 211 | git \ 212 | unzip \ 213 | openssh-client \ 214 | && docker-php-ext-install \ 215 | zip \ 216 | && curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer --version $COMPOSER_VERSION \ 217 | && composer global require hirak/prestissimo 218 | # Set up the command arguments 219 | CMD ["-"] 220 | ENTRYPOINT ["composer", "--ansi"] 221 | -------------------------------------------------------------------------------- /rabbitmq/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM rabbitmq:3.6-management-alpine 2 | 3 | # VAR ${VAR: -"value"} means the values may be overriden 4 | 5 | ENV RABBITMQ_NODENAME ${RABBITMQ_NODENAME:-"prooph"} 6 | ENV RABBITMQ_ERLANG_COOKIE ${RABBITMQ_ERLANG_COOKIE:-"1752650cd92f14813b66e1c976c51cccedd224a7"} 7 | ENV RABBITMQ_DEFAULT_USER ${RABBITMQ_DEFAULT_USER:-"prooph"} 8 | ENV RABBITMQ_DEFAULT_PASS ${RABBITMQ_DEFAULT_PASS:-"prooph"} 9 | 10 | ENV RABBITMQ_SSL_CACERTFILE ${RABBITMQ_SSL_CACERTFILE:-"/etc/rabbitmq/ssl/cacert.pem"} 11 | ENV RABBITMQ_SSL_CERTFILE ${RABBITMQ_SSL_CERTFILE:-"/etc/rabbitmq/ssl/localhost.crt"} 12 | ENV RABBITMQ_SSL_KEYFILE ${RABBITMQ_SSL_KEYFILE:-"/etc/rabbitmq/ssl/localhost.key"} 13 | ENV RABBITMQ_SSL_VERIFY ${RABBITMQ_SSL_VERIFY:-"verify_none"} 14 | ENV RABBITMQ_SSL_FAIL_IF_NO_PEER_CERT ${RABBITMQ_SSL_FAIL_IF_NO_PEER_CERT:-"false"} 15 | # Override the default configuration that is created by the default entrypoint script 16 | ENV RABBITMQ_CONFIG_FILE ${RABBITMQ_CONFIG_FILE:-"/etc/rabbitmq/rabbitmq-prooph"} 17 | # Without this erlang argument you will not be able to connect over TLS using the rabbitctl cli tool 18 | ENV RABBITMQ_CTL_ERL_ARGS ${RABBITMQ_CTL_ERL_ARGS:-"-proto_dist inet_tls"} 19 | 20 | # Copy self signed certificates 21 | COPY config/ssl/ /etc/rabbitmq/ssl 22 | 23 | # Add custom plugins 24 | COPY config/etc/enabled_plugins /etc/rabbitmq/enabled_plugins 25 | 26 | # Insert custom configuration 27 | COPY config/etc/rabbitmq-prooph.config /etc/rabbitmq/ 28 | RUN chown rabbitmq /etc/rabbitmq/rabbitmq-prooph.config && \ 29 | chgrp rabbitmq /etc/rabbitmq/rabbitmq-prooph.config 30 | 31 | # Add mgmt definitions 32 | COPY config/opt/definitions.json /opt/definitions.json 33 | 34 | -------------------------------------------------------------------------------- /rabbitmq/README.md: -------------------------------------------------------------------------------- 1 | # RabbitMQ Docker files with Alpine Linux 2 | 3 | > These images are only for development environments 4 | 5 | ## Built upon 6 | 7 | The [official](https://hub.docker.com/_/rabbitmq/) rabbitmq docker images, specifically alpine with the management plugin enabled. 8 | 9 | ## What does this image do? 10 | 11 | - Configures rabbitmq to use TLS with a self-signed localhost certificate. 12 | - Enables the management plugin. 13 | - Sets a default adminstrator `prooph` user with password `prooph`. 14 | - Enables the webstomp plugin. 15 | - Adds a vhost `proophessor-do`, a user `proophessor-do` with password `proophessor-do` and configures it's permissions. 16 | 17 | ## What doesn't it do? 18 | 19 | - Have a persisted database. 20 | - Managing fine grained users, vhosts and permissions. 21 | - Cluster setup. 22 | - Allows for plugin configuration. 23 | 24 | ## Get started 25 | 26 | Use the following image: `prooph/rabbitmq`. 27 | 28 | ``` 29 | docker run -d --hostname my-rabbit --name rabbitmq -p 8080:15671 prooph/rabbitmq 30 | ``` 31 | 32 | Then navigate to [https://localhost:8080](https://localhost:8080) to login with user `prooph` and `prooph` as password. 33 | 34 | ## Websockets 35 | 36 | We've enabled the webstomp plugin. 37 | 38 | ``` 39 | docker run -d --hostname my-rabbit --name rabbitmq -p 8080:15671 -p 15691:15691 prooph/rabbitmq 40 | ``` 41 | 42 | You'll need to connect to port 15691. 43 | 44 | 45 | ## Testing 46 | 47 | To test the server with some standard examples from RabbitMQ spin up a webserver and navigate to [https://localhost:8080](https://localhost:8000) 48 | 49 | ``` 50 | php -S localhost:8000 -t rabbitmq/test 51 | ``` 52 | 53 | ## Configuration 54 | 55 | Mount your own configuration to `/opt/definitions.json`. The easiest way to create a configuration file is by using 56 | the management UI (see Get started section). Configure your exchanges etc. and then simply export the configuration file (overview tab). 57 | Let docker mount the file into the container: 58 | 59 | ``` 60 | docker run -d --hostname my-rabbit --name rabbitmq -p 8080:15671 -v /my_config.json:/opt/definitions.json:ro prooph/rabbitmq 61 | ``` 62 | -------------------------------------------------------------------------------- /rabbitmq/config/etc/enabled_plugins: -------------------------------------------------------------------------------- 1 | [rabbitmq_management,rabbitmq_stomp,rabbitmq_web_stomp]. 2 | -------------------------------------------------------------------------------- /rabbitmq/config/etc/rabbitmq-prooph.config: -------------------------------------------------------------------------------- 1 | [ 2 | { rabbit, [ 3 | { loopback_users, [ ] }, 4 | { tcp_listeners, [ ] }, 5 | { ssl_listeners, [ 5671 ] }, 6 | { ssl_options, [ 7 | { cacertfile, "/etc/rabbitmq/ssl/cacert.pem" }, 8 | { certfile, "/etc/rabbitmq/ssl/localhost.crt" }, 9 | { fail_if_no_peer_cert, false }, 10 | { keyfile, "/etc/rabbitmq/ssl/localhost.key" }, 11 | { verify, verify_none } 12 | ] }, 13 | { default_pass, <<"prooph">> }, 14 | { default_user, <<"prooph">> }, 15 | { hipe_compile, false } 16 | ] }, 17 | { rabbitmq_management, [ { listener, [ 18 | { port, 15671 }, 19 | { ssl, true }, 20 | { ssl_opts, [ 21 | { cacertfile, "/etc/rabbitmq/ssl/cacert.pem" }, 22 | { certfile, "/etc/rabbitmq/ssl/localhost.crt" }, 23 | { fail_if_no_peer_cert, false }, 24 | { keyfile, "/etc/rabbitmq/ssl/localhost.key" }, 25 | { verify, verify_none } 26 | ] } 27 | ] }, {load_definitions, "/opt/definitions.json"} ] }, 28 | { rabbitmq_web_stomp, [ { ssl_config, [ 29 | { port, 15691 }, 30 | { backlog, 1024 }, 31 | { cacertfile, "/etc/rabbitmq/ssl/cacert.pem" }, 32 | { certfile, "/etc/rabbitmq/ssl/localhost.crt" }, 33 | { keyfile, "/etc/rabbitmq/ssl/localhost.key" }, 34 | { password, "" } 35 | ] } ] } 36 | ]. 37 | -------------------------------------------------------------------------------- /rabbitmq/config/opt/definitions.json: -------------------------------------------------------------------------------- 1 | { 2 | "rabbit_version": "3.6.11", 3 | "users": [ 4 | { 5 | "name": "prooph", 6 | "password_hash": "HFltdXMSRquDPIg3DUZ4sp4RtDZRGKnheSAo2XJUnxQ583CU", 7 | "hashing_algorithm": "rabbit_password_hashing_sha256", 8 | "tags": "administrator" 9 | }, 10 | { 11 | "name": "proophessor-do", 12 | "password_hash": "K/2G20hMRrwXzgOah1Sq5YxC6OY0SUX56n4OejEVAW7JLTCP", 13 | "hashing_algorithm": "rabbit_password_hashing_sha256", 14 | "tags": "" 15 | } 16 | ], 17 | "vhosts": [ 18 | { 19 | "name": "/" 20 | }, 21 | { 22 | "name": "proophessor-do" 23 | } 24 | ], 25 | "permissions": [ 26 | { 27 | "user": "prooph", 28 | "vhost": "/", 29 | "configure": ".*", 30 | "write": ".*", 31 | "read": ".*" 32 | }, 33 | { 34 | "user": "prooph", 35 | "vhost": "proophessor-do", 36 | "configure": ".*", 37 | "write": ".*", 38 | "read": ".*" 39 | }, 40 | { 41 | "user": "proophessor-do", 42 | "vhost": "proophessor-do", 43 | "configure": ".*", 44 | "write": ".*", 45 | "read": ".*" 46 | } 47 | ], 48 | "parameters": [], 49 | "global_parameters": [ 50 | { 51 | "name": "cluster_name", 52 | "value": "prooph@e3aaae0c45e7" 53 | } 54 | ], 55 | "policies": [], 56 | "queues": [], 57 | "exchanges": [], 58 | "bindings": [] 59 | } -------------------------------------------------------------------------------- /rabbitmq/config/ssl/localhost.crt: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIIDIDCCAgigAwIBAgIJAMMzy6s3+mYoMA0GCSqGSIb3DQEBBQUAMBQxEjAQBgNV 3 | BAMTCWxvY2FsaG9zdDAeFw0xNzA2MTkxMzE3NDlaFw0zMjA2MTUxMzE3NDlaMBQx 4 | EjAQBgNVBAMTCWxvY2FsaG9zdDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC 5 | ggEBAMPf+4x+vXkH24t3UEu8ZARFvuDBHpVJkuSNS3XsUDGBNjwejs4zzpqgAhmn 6 | zn9Ue9fG9HXGY92CDHRFyHWPqBNK7cyA+ianxNeCqZEsppWxkvDxabNqCrlBkCI3 7 | 4gJAKXiPPHEYGPCr+wVFfEO2XdmEs0jkEAvtl9337Zz9zcIfD3NQJa7fdepJrTpH 8 | hvZAcVgtyQAtwH7Zx+cA3rWRuPlPBc/bgXb4F8Z173UEXRsi2i/6CC7cdDqwGl6+ 9 | qlvOn8uTNRZzpIN3O+qPKri/233MLLhzWokTdnYSuG0RPiKL3oR6I/u5F+pIunRn 10 | jNl+eSF3vaJ4JSnu+tORy9+K5JsCAwEAAaN1MHMwHQYDVR0OBBYEFOveL5qRAkWh 11 | h/C2nuKsxyhSGz09MEQGA1UdIwQ9MDuAFOveL5qRAkWhh/C2nuKsxyhSGz09oRik 12 | FjAUMRIwEAYDVQQDEwlsb2NhbGhvc3SCCQDDM8urN/pmKDAMBgNVHRMEBTADAQH/ 13 | MA0GCSqGSIb3DQEBBQUAA4IBAQA6HLBURuox7xKe9iQk+6/hsVCFLkpSSmIrYC5V 14 | um43GKVDGu1caAMGvQADTplScVHqU82HIGArpUPb//XRET05OHDMnXdmPV0+iNf1 15 | T5r9iaz/VQk2/U4bjA4XgfZS/CmwSovQP6bKy410KzJYVTnMUNk2PZS6oKd9EWTj 16 | nhRRX/maz915QsnVlxvk4xbVXVD0BEUq5gK/ppQUqo0gScVb8COoMycVWWL7Nd5N 17 | TvvbxDOIP56je1Yfs5+IGlDUqGCLVuHMK9Wu3FgtucJfVeM1/4VQRG1d273yW5wV 18 | AyxT56n8DMoyuyGsbMxEpZ/8vV4zoC9/eH6OsopERyaXkfjK 19 | -----END CERTIFICATE----- 20 | -------------------------------------------------------------------------------- /rabbitmq/config/ssl/localhost.key: -------------------------------------------------------------------------------- 1 | -----BEGIN RSA PRIVATE KEY----- 2 | MIIEowIBAAKCAQEAw9/7jH69eQfbi3dQS7xkBEW+4MEelUmS5I1LdexQMYE2PB6O 3 | zjPOmqACGafOf1R718b0dcZj3YIMdEXIdY+oE0rtzID6JqfE14KpkSymlbGS8PFp 4 | s2oKuUGQIjfiAkApeI88cRgY8Kv7BUV8Q7Zd2YSzSOQQC+2X3fftnP3Nwh8Pc1Al 5 | rt916kmtOkeG9kBxWC3JAC3AftnH5wDetZG4+U8Fz9uBdvgXxnXvdQRdGyLaL/oI 6 | Ltx0OrAaXr6qW86fy5M1FnOkg3c76o8quL/bfcwsuHNaiRN2dhK4bRE+IovehHoj 7 | +7kX6ki6dGeM2X55IXe9onglKe7605HL34rkmwIDAQABAoIBAD90XTp7iIgf+oio 8 | 43NVmZUkvxxyk6TLS/IMsAiIwMX41QgO4jZ85A6FjYigKy5mwSP7CRDqb0nAKqa0 9 | QKeNHWb6nCTnF6LUMNmcM7CbJXBTMYYqvxJnZQf07GuZbPdLr+Oli3Ab3WCCZnSj 10 | uQj6mFayPZ58e5JRqyQ2gFyegDzFX+8/wu7Rx1HaN4JPfPkQbhGH9rHIZO+X83Tf 11 | Xy81x6MxQa+4I1iubn8nl7wS+zuzooSty2SXWvc/9eLOUreXE2qNfuNV71WuriG/ 12 | x0HqV5PhLP1SiLFrlDQAkhI9DLi2LJP4UVWyemUW9UTmvYynebVx3ovG/UvQsVlD 13 | iDFpPXECgYEA6nmnKtchBz0efkq/9exhyM27SKo1s3XrMjN1/PU/dUEsFRXM6/Ms 14 | mvjQQx2YveXZWkqZsl9DQeJry1JL4JpwgGL8zW/cBfc+NxoLxCJvgVPyLyKj4zhf 15 | RzZqDbJAsKqxfcsBQmzb3BxE2CIxNYLZNFtGoRQZtUVw08erVaU7w0MCgYEA1dsx 16 | jotWOg97Wf/5+uAoJjhba32pi7PgmNm+apayt48tYkaX3JwqnBMDzEx8w7Lxhd92 17 | 1ZI3CgQdtcKXcx7tTCKzixpTVvoeIc71etkYU1YI0A+Tg6m8VAGKIrUiSw5062+n 18 | xTW8Ijw7TC25ojBTUbaU/7GkyBkW1sco8Xi9R8kCgYAi7CWSwuHfcyH0i2uV1DQo 19 | NUQcqYVACmMSYgnDuD9QVnmbVljkF57gIgjaxjC2r+I0iYHkyD17NZ76dHJqrHXv 20 | GU8vxeZOWSnCCTYRa1OSPo+Gp7EjKYU/VQJsscziwzmWU8MHQrFoUimKy2Tq5Gc3 21 | XhTh7t15WzNXx5hkNCz3gwKBgC9tKvJXyEmcAVkWQZP3fi/rs6qE9cK7o4WCVI5C 22 | 2WOH5yKyUR9lqrVuKht2ovyrhJCR3ELE6FvaSdRzUS8AntORpoukzPKvCVuqEBqs 23 | Zo6kt9OcgLRkQhXHOaE01mQa0qcb3fMIVa6p+OSOB2sGmJO4kBaciNSva7c598SF 24 | aESxAoGBAIKg6xbfSC+6NeUIRgy6lo+vjnwsN0zUa5KosyPqgZD7KLZQrrD/nfqy 25 | 8N7VepbQzGlFi7pfLYc/zidpAAq1QT9aBXmXMFw/+RYIy1s1wuv1xXSee3ggwbyO 26 | 04V9+WBSRYK0a1INYkZT3EMYOkfcNXITz/dTDuUzq+/5YMO0NTQM 27 | -----END RSA PRIVATE KEY----- 28 | -------------------------------------------------------------------------------- /rabbitmq/test/bunny.html: -------------------------------------------------------------------------------- 1 | 2 |
3 | 4 | 5 | 6 | 7 | 24 |When you type text in the form's input, the application will send a message to the /queue/test
destination
49 | with the reply-to
header set to /temp-queue/foo
.
The STOMP client sets a default onreceive
callback to receive messages from this temporary queue and display the message's text.
Finally, the client subscribes to the /queue/test
destination. When it receives message from this destination, it reverses the message's
52 | text and reply by sending the reversed text to the destination defined by the message's reply-to
header.