Skip to content
This repository has been archived by the owner on Oct 16, 2020. It is now read-only.

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
benjamin.brandt committed Jun 17, 2019
1 parent e5e1b3a commit 8528f1d
Show file tree
Hide file tree
Showing 6 changed files with 116 additions and 0 deletions.
67 changes: 67 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
FROM ubuntu:18.04
MAINTAINER Benjamin Brandt <benjamin.brandt@startnext.com>

ENV DEBIAN_FRONTEND noninteractive

# Always required for myty
RUN apt-get update && apt-get install -y \
mariadb-client \
php-fpm \
php-cli \
php-gd \
php-imagick \
php-apcu \
php-igbinary \
php-tidy \
php-mysql \
php-yaml \
php-zip \
php-intl \
php-bcmath \
php-memcached \
php-curl \
php-mbstring \
php-opcache \
php-json \
php-readline \
php-xmlrpc \
php-http-request2 \
locales \
jpegoptim \
optipng \
wget \
curl \
&& rm /etc/php/7.2/cli/php.ini \
&& rm /etc/php/7.2/fpm/pool.d/www.conf \
&& apt-get autoremove --purge -y \
php7.2-phpdbg \
xauth \
&& rm -rf /var/lib/apt/lists/*

RUN mkdir /run/php/

RUN echo "$(curl -sS https://composer.github.io/installer.sig) -" > composer-setup.php.sig \
&& curl -sS https://getcomposer.org/installer | tee composer-setup.php | sha384sum -c composer-setup.php.sig \
&& php composer-setup.php && rm composer-setup.php* \
&& chmod +x composer.phar && mv composer.phar /usr/bin/composer

# Copy PHP config
COPY etc/ /etc/

# Copy Sourceguardian
COPY ext /usr/local/sourceguardian

RUN ln -s /etc/php/7.2/mods-available/myty_php_cli.ini /etc/php/7.2/fpm/myty_php_cli.ini \
&& ln -s /etc/php/7.2/mods-available/myty_php_fpm.ini /etc/php/7.2/fpm/myty_php_fpm.ini \
&& locale-gen \
&& phpdismod\
memcached \
&& phpenmod \
myty \
sourceguardian

WORKDIR /var/www/web

EXPOSE 9001

CMD ["php-fpm7.2", "--nodaemonize"]
4 changes: 4 additions & 0 deletions etc/php/7.2/fpm/php-fpm.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[global]
pid = /run/php/php7.2-fpm.pid
error_log = syslog
include=/etc/php/7.2/fpm/pool.d/*.conf
11 changes: 11 additions & 0 deletions etc/php/7.2/fpm/pool.d/www.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[www]
request_terminate_timeout = 60
user = www-data
group = www-data
listen = 0.0.0.0:9001
pm = dynamic
pm.max_children = 5
pm.start_servers = 2
pm.min_spare_servers = 1
pm.max_spare_servers = 3
pm.max_requests = 500
28 changes: 28 additions & 0 deletions etc/php/7.2/mods-available/myty.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
; This is the php.ini file with change the defaults for myty.
date.timezone = "Europe/Berlin"
igbinary.compact_strings=On
display_errors=Off
log_errors = On
allow_url_fopen = On
expose_php = Off
error_log = /dev/stderr
session.gc_maxlifetime = 7200
session.gc_probability = 0
opcache.memory_consumption=128M;
opcache.interned_strings_buffer=8;
opcache.revalidate_freq=360;
opcache.enable_file_override=1;
opcache.max_accelerated_files=4000;
opcache.fast_shutdown=1;
opcache.enable_cli=0;
error_reporting = E_ALL & ~E_DEPRECATED & ~E_USER_DEPRECATED & ~E_NOTICE & ~E_STRICT
display_errors = 0
short_open_tag = On
post_max_size = 16M
upload_max_filesize = 16M
apc.shm_size = 64M
max_execution_time = 360
max_input_time = 360
max_input_vars = 10000
apc.serializer=igbinary
memcached.serializer=igbinary
3 changes: 3 additions & 0 deletions etc/php/7.2/mods-available/myty_php_cli.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
; This is the php.ini cli file with change the defaults for myty.
memory_limit = -1
apc.enable_cli = 1
3 changes: 3 additions & 0 deletions etc/php/7.2/mods-available/myty_php_fpm.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
; This is the php.ini fpm file with change the defaults for myty.
memory_limit = 128M

0 comments on commit 8528f1d

Please sign in to comment.