├── .dockerignore
├── .github
└── ISSUE_TEMPLATE
│ ├── bug_report.md
│ └── feature_request.md
├── .gitignore
├── CODE_OF_CONDUCT.md
├── LICENSE
├── Makefile
├── README.md
├── apache
├── Dockerfile
└── vhosts
│ └── magento.conf
├── docker-compose.yml
├── docker-env.dist
├── mysql
├── Dockerfile
└── conf.d
│ └── custom.cnf
└── php
├── Dockerfile
├── conf
├── php-cli.ini
└── php.ini
└── entrypoint.sh
/.dockerignore:
--------------------------------------------------------------------------------
1 | .idea/
2 | .git/
3 | .gitignore
4 | .gitkeep
5 | LICENSE
6 | README.md
7 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/bug_report.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Bug report
3 | about: Create a report to help us improve
4 |
5 | ---
6 |
7 | **Describe the bug**
8 | A clear and concise description of what the bug is.
9 |
10 | **To Reproduce**
11 | Steps to reproduce the behavior:
12 | 1. Go to '...'
13 | 2. Click on '....'
14 | 3. Scroll down to '....'
15 | 4. See error
16 |
17 | **Expected behavior**
18 | A clear and concise description of what you expected to happen.
19 |
20 | **Screenshots**
21 | If applicable, add screenshots to help explain your problem.
22 |
23 | **Desktop (please complete the following information):**
24 | - OS: [e.g. iOS]
25 | - Browser [e.g. chrome, safari]
26 | - Version [e.g. 22]
27 |
28 | **Smartphone (please complete the following information):**
29 | - Device: [e.g. iPhone6]
30 | - OS: [e.g. iOS8.1]
31 | - Browser [e.g. stock browser, safari]
32 | - Version [e.g. 22]
33 |
34 | **Additional context**
35 | Add any other context about the problem here.
36 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/feature_request.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Feature request
3 | about: Suggest an idea for this project
4 |
5 | ---
6 |
7 | **Is your feature request related to a problem? Please describe.**
8 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
9 |
10 | **Describe the solution you'd like**
11 | A clear and concise description of what you want to happen.
12 |
13 | **Describe alternatives you've considered**
14 | A clear and concise description of any alternative solutions or features you've considered.
15 |
16 | **Additional context**
17 | Add any other context or screenshots about the feature request here.
18 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | /apache/vhosts/*
2 | !/apache/vhosts/magento.conf
3 | docker-env
4 |
--------------------------------------------------------------------------------
/CODE_OF_CONDUCT.md:
--------------------------------------------------------------------------------
1 | # Contributor Covenant Code of Conduct
2 |
3 | ## Our Pledge
4 |
5 | In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
6 |
7 | ## Our Standards
8 |
9 | Examples of behavior that contributes to creating a positive environment include:
10 |
11 | * Using welcoming and inclusive language
12 | * Being respectful of differing viewpoints and experiences
13 | * Gracefully accepting constructive criticism
14 | * Focusing on what is best for the community
15 | * Showing empathy towards other community members
16 |
17 | Examples of unacceptable behavior by participants include:
18 |
19 | * The use of sexualized language or imagery and unwelcome sexual attention or advances
20 | * Trolling, insulting/derogatory comments, and personal or political attacks
21 | * Public or private harassment
22 | * Publishing others' private information, such as a physical or electronic address, without explicit permission
23 | * Other conduct which could reasonably be considered inappropriate in a professional setting
24 |
25 | ## Our Responsibilities
26 |
27 | Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
28 |
29 | Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
30 |
31 | ## Scope
32 |
33 | This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
34 |
35 | ## Enforcement
36 |
37 | Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at aja@emakina.fr. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
38 |
39 | Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
40 |
41 | ## Attribution
42 |
43 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]
44 |
45 | [homepage]: http://contributor-covenant.org
46 | [version]: http://contributor-covenant.org/version/1/4/
47 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2016-2018 Emakina.FR https://www.emakina.fr/
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/Makefile:
--------------------------------------------------------------------------------
1 | apache: ## Open a terminal in the "apache" container
2 | @docker compose exec apache sh
3 |
4 | build: ## Build the environment
5 | @docker compose build --pull
6 |
7 | cache: ## Flush cache stored in Redis
8 | @docker compose exec -T redis sh -c "redis-cli FLUSHALL"
9 |
10 | install: build start ## Install the environment
11 |
12 | logs: ## Follow logs generated by all containers
13 | @docker compose logs -f --tail=0
14 |
15 | logs-full: ## Follow logs generated by all containers from the containers creation
16 | @docker compose logs -f
17 |
18 | mysql: ## Open a terminal in the "mysql" container
19 | @docker compose exec mysql bash
20 |
21 | php: ## Open a terminal in the "php" container
22 | @docker compose exec php sh
23 |
24 | ps: ## List all containers managed by the environment
25 | @docker compose ps
26 |
27 | purge: ## Purge all services, associated volumes
28 | @docker compose down --volumes
29 |
30 | restart: stop start ## Restart the environment
31 |
32 | start: ## Start the environment
33 | @if [[ ! -f docker-env ]]; then \
34 | echo 'The default configuration has been applied because the "docker-env" file was not configured.'; \
35 | cp docker-env.dist docker-env; \
36 | fi
37 | @docker compose up --detach --remove-orphans
38 |
39 | stats: ## Print real-time statistics about containers ressources usage
40 | @docker stats $(docker ps --format={{.Names}})
41 |
42 | ssh: ## Copy all SSH keys from the host to the "php" container
43 | docker compose exec -T php sh -c "mkdir -p /root/.ssh"
44 | docker cp $(HOME)/.ssh $(shell docker-compose ps -q php):/root/
45 | docker compose exec -T php sh -c "echo 'eval \$$(ssh-agent) && ssh-add' >> /root/.bashrc"
46 | docker compose exec -T php sh -c "rm /root/.ssh/config"
47 |
48 | stop: ## Stop the environment
49 | @docker compose stop
50 |
51 | .PHONY: apache build cache install logs logs-full mysql php ps purge restart start stats ssh stop
52 |
53 | .DEFAULT_GOAL := help
54 | help:
55 | @grep -E '(^[a-zA-Z_-]+:.*?##.*$$)|(^##)' $(MAKEFILE_LIST) \
56 | | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[32m%-30s\033[0m %s\n", $$1, $$2}' \
57 | | sed -e 's/\[32m##/[33m/'
58 | .PHONY: help
59 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Docker for Magento
2 | [](https://opensource.org/licenses/MIT)
3 |
4 | This repository allows the creation of a Docker environment that meets
5 | [Magento 1](http://devdocs.magento.com/guides/m1x/system-requirements.html) requirements.
6 |
7 | :warning: **The `master` branch uses PHP 7.2 which is not compatible with Magento by default. The latest version with
8 | PHP 5.6 is available under the tag [v2.3](https://github.com/EmakinaFR/docker-magento/releases/tag/v2.3) if you do not
9 | plan to upgrade your PHP version.** :warning:
10 |
11 | ## Images
12 | * `httpd:2.4-alpine`: [custom image](https://github.com/EmakinaFR/docker-magento/blob/master/apache/Dockerfile) with apache 2.4 (web server).
13 | * `blackfire/blackfire:latest`: application profiling.
14 | * `djfarrelly/maildev:latest`: emails web Interface for viewing and testing emails during development.
15 | * `mongo:3.6`: additional database.
16 | * `mysql:8`: magento database.
17 | * `php:7.2-fpm-alpine`: [custom image](https://github.com/EmakinaFR/docker-magento/blob/master/php/Dockerfile) with php-fpm 7.2.
18 | * `redis:6-alpine`: magento sessions and caches.
19 |
20 | ## Additional Features
21 | Since this environment is designed for a local usage, it comes with features helping the development workflow.
22 |
23 | The `apache` and `php` containers have a mount point used to share source files.
24 | By default, the `~/www/` directory is mounted from the host. It's possible to change this path by editing
25 | the `docker-compose.yml` file.
26 |
27 | It's also possible to add custom virtual hosts: all `./apache/vhosts/*.conf` files are copied in the Apache directory
28 | during the image build process.
29 |
30 | And the `./php/custom.ini` file is used to customize the PHP configuration during the image build process.
31 |
32 | ## Installation
33 | This process assumes that [Docker Engine](https://www.docker.com/docker-engine)
34 | and [Docker Compose](https://docs.docker.com/compose/) are installed.
35 | Otherwise, you should have a look to [Install Docker Engine](https://docs.docker.com/engine/installation/)
36 | before proceeding further.
37 |
38 | ### Clone the repository
39 | ```bash
40 | $ git clone git@github.com:EmakinaFR/docker-magento.git magento1
41 | ```
42 | It's also possible to download it as a [ZIP archive](https://github.com/EmakinaFR/docker-magento/archive/master.zip).
43 |
44 | ### Configure the environment variables (optional)
45 | ```bash
46 | $ make env
47 | ```
48 |
49 | ### Build the environment
50 | ```bash
51 | $ make install
52 | ```
53 |
54 | ### Check the containers
55 | ```bash
56 | $ make ps
57 | Name Command State Ports
58 | --------------------------------------------------------------------------------------------
59 | magento1_apache_1 httpd-foreground Up 0.0.0.0:443->443/tcp, 80/tcp
60 | magento1_blackfire_1 blackfire-agent Up 8707/tcp
61 | magento1_maildev_1 bin/maildev --web 80 --smtp 25 Up 25/tcp, 0.0.0.0:1080->80/tcp
62 | magento1_mongo_1 docker-entrypoint.sh mongod Up 0.0.0.0:27017->27017/tcp
63 | magento1_mysql_1 docker-entrypoint.sh mysqld Up 0.0.0.0:3306->3306/tcp
64 | magento1_php_1 docker-custom-entrypoint p ... Up 9000/tcp
65 | magento1_redis_1 docker-entrypoint.sh redis ... Up 6379/tcp
66 | ```
67 | Note: You will see something slightly different if you do not clone the repository in a `magento1` directory.
68 | The container prefix depends on your directory name.
69 |
--------------------------------------------------------------------------------
/apache/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM httpd:2.4-alpine
2 |
3 | # Install Apache requirements
4 | RUN apk add --no-cache --virtual .persistent-deps openssl
5 |
6 | # Install custom Apache configuration
7 | COPY vhosts /usr/local/apache2/conf/extra/vhosts
8 | RUN \
9 | perl -pi -e "s|#ServerName www.example.com:80|ServerName localhost:80|g" /usr/local/apache2/conf/httpd.conf && \
10 | perl -pi -e "s|#LoadModule http2_module modules/mod_http2.so|LoadModule http2_module modules/mod_http2.so|g" /usr/local/apache2/conf/httpd.conf && \
11 | perl -pi -e "s|#LoadModule proxy_module modules/mod_proxy.so|LoadModule proxy_module modules/mod_proxy.so|g" /usr/local/apache2/conf/httpd.conf && \
12 | perl -pi -e "s|#LoadModule proxy_fcgi_module modules/mod_proxy_fcgi.so|LoadModule proxy_fcgi_module modules/mod_proxy_fcgi.so|g" /usr/local/apache2/conf/httpd.conf && \
13 | perl -pi -e "s|#LoadModule rewrite_module modules/mod_rewrite.so|LoadModule rewrite_module modules/mod_rewrite.so|g" /usr/local/apache2/conf/httpd.conf && \
14 | perl -pi -e "s|#LoadModule socache_shmcb_module modules/mod_socache_shmcb.so|LoadModule socache_shmcb_module modules/mod_socache_shmcb.so|g" /usr/local/apache2/conf/httpd.conf && \
15 | perl -pi -e "s|#LoadModule ssl_module modules/mod_ssl.so|LoadModule ssl_module modules/mod_ssl.so|g" /usr/local/apache2/conf/httpd.conf && \
16 | perl -pi -e "s|/usr/local/apache2/htdocs|/var/www/html|g" /usr/local/apache2/conf/httpd.conf && \
17 | perl -pi -e "s|#Include conf/extra/httpd-ssl.conf|Include conf/extra/httpd-ssl.conf|g" /usr/local/apache2/conf/httpd.conf && \
18 | perl -pi -e "s|#Include conf/extra/httpd-vhosts.conf|Include conf/extra/vhosts/*.conf|g" /usr/local/apache2/conf/httpd.conf
19 |
20 | # Generate self-signed SSL certificate
21 | RUN \
22 | mkdir -p /etc/ssl/private/ /etc/ssl/certs/ && \
23 | openssl req -x509 -nodes -days 365 -newkey rsa:2048 \
24 | -keyout /usr/local/apache2/conf/server.key \
25 | -out /usr/local/apache2/conf/server.crt \
26 | -subj "/CN=localhost"
27 |
28 | WORKDIR /var/www/html
29 |
--------------------------------------------------------------------------------
/apache/vhosts/magento.conf:
--------------------------------------------------------------------------------
1 | Protocols h2 http/1.1
2 |
3 | SSLEngine On
4 | SSLCertificateKeyFile /usr/local/apache2/conf/server.key
5 | SSLCertificateFile /usr/local/apache2/conf/server.crt
6 |
7 |
8 | RewriteEngine Off
9 |
10 |
11 |
12 | SetHandler "proxy:fcgi://php:9000"
13 |
14 |
15 | #
16 | # ServerName www.magento.localhost
17 | # ServerAlias magento.localhost *.magento.localhost
18 | # DocumentRoot /var/www/html/magento
19 | #
20 |
--------------------------------------------------------------------------------
/docker-compose.yml:
--------------------------------------------------------------------------------
1 | version: "3"
2 |
3 | services:
4 | apache:
5 | build: apache
6 | env_file: docker-env
7 | depends_on:
8 | - php
9 | ports:
10 | - "443:443"
11 | volumes:
12 | - ~/www:/var/www/html:rw,delegated
13 | tty: true
14 |
15 | blackfire:
16 | image: blackfire/blackfire:latest
17 | env_file: docker-env
18 | depends_on:
19 | - apache
20 | - php
21 |
22 | maildev:
23 | image: maildev/maildev
24 | environment:
25 | MAILDEV_SMTP_PORT: 25
26 | depends_on:
27 | - apache
28 | ports:
29 | - "1080:1080"
30 |
31 | mongo:
32 | image: mongo:3.6
33 | env_file: docker-env
34 | ports:
35 | - "27017:27017"
36 | volumes:
37 | - mongo:/data/db
38 | tty: true
39 |
40 | mysql:
41 | build: mysql
42 | env_file: docker-env
43 | ports:
44 | - "3306:3306"
45 | volumes:
46 | - mysql:/var/lib/mysql
47 | - ./mysql/conf.d/custom.cnf:/etc/mysql/conf.d/custom.cnf:ro
48 | tty: true
49 |
50 | php:
51 | build: php
52 | env_file: docker-env
53 | environment:
54 | - SSH_AUTH_SOCK=/run/host-services/ssh-auth.sock
55 | volumes:
56 | - ~/www:/var/www/html:rw,delegated
57 | # SSH socket
58 | - /run/host-services/ssh-auth.sock:/run/host-services/ssh-auth.sock
59 | tty: true
60 |
61 | redis:
62 | image: redis:6-alpine
63 | env_file: docker-env
64 | tty: true
65 |
66 | volumes:
67 | mongo: {}
68 | mysql: {}
69 |
--------------------------------------------------------------------------------
/docker-env.dist:
--------------------------------------------------------------------------------
1 | ##### BLACKFIRE
2 | BLACKFIRE_PORT=8707
3 | BLACKFIRE_LOG_LEVEL=4
4 | BLACKFIRE_SERVER_ID=
5 | BLACKFIRE_SERVER_TOKEN=
6 | BLACKFIRE_CLIENT_ID=
7 | BLACKFIRE_CLIENT_TOKEN=
8 |
9 | ##### MYSQL
10 | MYSQL_ALLOW_EMPTY_PASSWORD=1
11 | MYSQL_ROOT_PASSWORD=
12 | MYSQL_USER=
13 | MYSQL_PASSWORD=
14 | MYSQL_DATABASE=
15 |
16 | ##### NGINX
17 | PROXY_PASS=http://apache
18 |
--------------------------------------------------------------------------------
/mysql/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM mysql:8-oracle
2 |
3 | RUN echo 'sql-mode="STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION"' >> /etc/mysql/conf.d/docker.cnf
4 | RUN echo 'information_schema_stats_expiry=0' >> /etc/mysql/conf.d/docker.cnf
5 |
--------------------------------------------------------------------------------
/mysql/conf.d/custom.cnf:
--------------------------------------------------------------------------------
1 | [mysqld]
2 | default_authentication_plugin= mysql_native_password
3 |
--------------------------------------------------------------------------------
/php/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM php:7.2-fpm-alpine
2 |
3 | # Install Magento requirements
4 | RUN \
5 | apk add --no-cache --virtual .persistent-deps \
6 | freetype-dev \
7 | git \
8 | jq \
9 | icu-libs \
10 | libjpeg-turbo-dev \
11 | libpng-dev \
12 | libxml2-dev \
13 | libxml2-utils \
14 | openssh-client \
15 | patch \
16 | perl \
17 | ssmtp \
18 | yarn && \
19 | apk add --no-cache --virtual .build-deps \
20 | $PHPIZE_DEPS \
21 | icu-dev && \
22 | docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ && \
23 | docker-php-ext-install -j$(nproc) \
24 | bcmath \
25 | intl \
26 | gd \
27 | opcache \
28 | pdo_mysql \
29 | soap \
30 | zip && \
31 | yes "" | pecl install apcu lzf mongodb redis && \
32 | docker-php-ext-enable apcu lzf mongodb redis && \
33 | curl -sS https://packages.blackfire.io/binaries/blackfire-php/1.22.0/blackfire-php-alpine_amd64-php-72.so \
34 | --output $(php -r "echo ini_get('extension_dir');")/blackfire.so && \
35 | perl -pi -e "s/mailhub=mail/mailhub=maildev/" /etc/ssmtp/ssmtp.conf && \
36 | perl -pi -e "s|;pm.status_path = /status|pm.status_path = /php_fpm_status|g" /usr/local/etc/php-fpm.d/www.conf && \
37 | pear channel-discover pear.phing.info && \
38 | pear install phing/phing && \
39 | yarn global add grunt-cli && \
40 | apk del .build-deps
41 |
42 | # Install Composer globally
43 | COPY --from=composer:1 /usr/bin/composer /usr/bin/composer
44 | ENV COMPOSER_ALLOW_SUPERUSER 1
45 | ENV COMPOSER_MEMORY_LIMIT -1
46 | RUN composer global require "hirak/prestissimo:dev-master" --no-suggest --optimize-autoloader --classmap-authoritative
47 |
48 | # Install custom PHP configuration
49 | COPY conf/* /usr/local/etc/php/
50 |
51 | # Install custom entrypoint
52 | COPY entrypoint.sh /usr/local/bin/docker-custom-entrypoint
53 | RUN chmod 777 /usr/local/bin/docker-custom-entrypoint
54 | CMD ["php-fpm"]
55 | ENTRYPOINT ["docker-custom-entrypoint"]
56 |
--------------------------------------------------------------------------------
/php/conf/php-cli.ini:
--------------------------------------------------------------------------------
1 | [apc]
2 | apc.enable_cli=On
3 |
4 | [asset]
5 | assert.active=Off
6 |
7 | [core]
8 | allow_url_fopen=On
9 | allow_url_include=Off
10 | always_populate_raw_post_data=-1
11 | display_errors=Off
12 | error_log=/var/log/apache2/php.log
13 | expose_php=Off
14 | max_execution_time=30
15 | max_input_time=60
16 | memory_limit=2G
17 | realpath_cache_size=1M
18 | realpath_cache_ttl=3600
19 | sendmail_path=/usr/sbin/ssmtp -t
20 | short_open_tag=Off
21 | SMTP=maildev
22 | smtp_port=25
23 | upload_max_filesize=120M
24 |
25 | [date]
26 | date.timezone=Europe/Paris
27 |
28 | [session]
29 | session.auto_start=Off
30 | session.gc_probability=Off
31 | session.use_strict_mode=1
32 |
33 | [opcache]
34 | opcache.enable_cli=On
35 | opcache.enable_file_override=On
36 | opcache.error_log=/var/log/apache2/opcache.log
37 | opcache.force_restart_timeout=600
38 | opcache.interned_strings_buffer=32
39 | opcache.load_comments=On
40 | opcache.log_verbosity_level=2
41 | opcache.max_accelerated_files=32531
42 | opcache.memory_consumption=256
43 | opcache.save_comments=On
44 | opcache.revalidate_freq=Off
45 | opcache.validate_timestamps=On
46 |
47 | [zend]
48 | zend.detect_unicode=Off
49 |
--------------------------------------------------------------------------------
/php/conf/php.ini:
--------------------------------------------------------------------------------
1 | [apc]
2 | apc.enable_cli=On
3 |
4 | [asset]
5 | assert.active=Off
6 |
7 | [core]
8 | allow_url_fopen=Off
9 | allow_url_include=Off
10 | always_populate_raw_post_data=-1
11 | display_errors=Off
12 | error_log=/var/log/apache2/php.log
13 | expose_php=Off
14 | max_execution_time=30
15 | max_input_time=60
16 | memory_limit=256M
17 | realpath_cache_size=1M
18 | realpath_cache_ttl=3600
19 | sendmail_path=/usr/sbin/ssmtp -t
20 | short_open_tag=Off
21 | SMTP=maildev
22 | smtp_port=25
23 | upload_max_filesize=120M
24 |
25 | [date]
26 | date.timezone=Europe/Paris
27 |
28 | [session]
29 | session.auto_start=Off
30 | session.gc_probability=Off
31 | session.use_strict_mode=1
32 |
33 | [opcache]
34 | opcache.enable_cli=On
35 | opcache.enable_file_override=On
36 | opcache.error_log=/var/log/apache2/opcache.log
37 | opcache.force_restart_timeout=600
38 | opcache.interned_strings_buffer=32
39 | opcache.load_comments=On
40 | opcache.log_verbosity_level=2
41 | opcache.max_accelerated_files=32531
42 | opcache.memory_consumption=256
43 | opcache.save_comments=On
44 | opcache.revalidate_freq=Off
45 | opcache.validate_timestamps=On
46 |
47 | [zend]
48 | zend.detect_unicode=Off
49 |
--------------------------------------------------------------------------------
/php/entrypoint.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env sh
2 | set -euo pipefail
3 |
4 | cat << CONFIG > "${PHP_INI_DIR}"/conf.d/blackfire.ini
5 | extension=blackfire.so
6 | blackfire.agent_socket=tcp://blackfire:${BLACKFIRE_PORT}
7 | blackfire.agent_timeout=5
8 | blackfire.log_file=/var/log/blackfire.log
9 | blackfire.log_level=${BLACKFIRE_LOG_LEVEL}
10 | blackfire.server_id=${BLACKFIRE_SERVER_ID}
11 | blackfire.server_token=${BLACKFIRE_SERVER_TOKEN}
12 | CONFIG
13 |
14 | exec "$@"
15 |
--------------------------------------------------------------------------------