Browse Source

Message de validation

Pascal PELISSIER 3 years ago
parent
commit
b30ec25346

+ 92
- 0
symfony/docker-lamp/1404/Dockerfile-php5 View File

@@ -0,0 +1,92 @@
1
+FROM phusion/baseimage:0.9.18
2
+MAINTAINER Matthew Rayner <hello@rayner.io>
3
+ENV REFRESHED_AT 2018-08-21
4
+
5
+# based on dgraziotin/lamp
6
+# MAINTAINER Daniel Graziotin <daniel@ineed.coffee>
7
+
8
+ENV DOCKER_USER_ID 501
9
+ENV DOCKER_USER_GID 20
10
+
11
+ENV BOOT2DOCKER_ID 1000
12
+ENV BOOT2DOCKER_GID 50
13
+
14
+# Tweaks to give Apache/PHP write permissions to the app
15
+RUN usermod -u ${BOOT2DOCKER_ID} www-data && \
16
+    usermod -G staff www-data && \
17
+    useradd -r mysql && \
18
+    usermod -G staff mysql
19
+
20
+RUN groupmod -g $(($BOOT2DOCKER_GID + 10000)) $(getent group $BOOT2DOCKER_GID | cut -d: -f1)
21
+RUN groupmod -g ${BOOT2DOCKER_GID} staff
22
+
23
+# Install packages
24
+ENV DEBIAN_FRONTEND noninteractive
25
+RUN add-apt-repository -y ppa:ondrej/php && \
26
+  apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 4F4EA0AAE5267A6C && \
27
+  apt-get update && \
28
+  apt-get -y upgrade && \
29
+ apt-get -y install supervisor wget git apache2 php-xdebug libapache2-mod-php5.6 mysql-server php5.6 php5.6-mysql pwgen php5.6-apc php5.6-mcrypt php5.6-gd php5.6-xml php5.6-mbstring php5.6-gettext zip unzip php5.6-zip curl php5.6-curl && \
30
+  apt-get -y autoremove && \
31
+  echo "ServerName localhost" >> /etc/apache2/apache2.conf
32
+
33
+# Update CLI PHP to use 5.6
34
+RUN ln -sfn /usr/bin/php5.6 /etc/alternatives/php
35
+
36
+# needed for phpMyAdmin
37
+RUN phpenmod mcrypt
38
+
39
+# Add image configuration and scripts
40
+ADD supporting_files/start-apache2.sh /start-apache2.sh
41
+ADD supporting_files/start-mysqld.sh /start-mysqld.sh
42
+ADD supporting_files/run.sh /run.sh
43
+RUN chmod 755 /*.sh
44
+ADD supporting_files/supervisord-apache2.conf /etc/supervisor/conf.d/supervisord-apache2.conf
45
+ADD supporting_files/supervisord-mysqld.conf /etc/supervisor/conf.d/supervisord-mysqld.conf
46
+ADD supporting_files/mysqld_innodb.cnf /etc/mysql/conf.d/mysqld_innodb.cnf
47
+
48
+# Allow mysql to bind on 0.0.0.0
49
+RUN sed -i "s/.*bind-address.*/bind-address = 0.0.0.0/" /etc/mysql/my.cnf
50
+
51
+# Set PHP timezones to Europe/London
52
+RUN sed -i "s/;date.timezone =/date.timezone = Europe\/London/g" /etc/php/5.6/apache2/php.ini
53
+RUN sed -i "s/;date.timezone =/date.timezone = Europe\/London/g" /etc/php/5.6/cli/php.ini
54
+
55
+# Remove pre-installed database
56
+RUN rm -rf /var/lib/mysql
57
+
58
+# Add MySQL utils
59
+ADD supporting_files/create_mysql_users.sh /create_mysql_users.sh
60
+RUN chmod 755 /*.sh
61
+
62
+# Add phpmyadmin
63
+ENV PHPMYADMIN_VERSION=4.8.2
64
+RUN wget -O /tmp/phpmyadmin.tar.gz https://files.phpmyadmin.net/phpMyAdmin/${PHPMYADMIN_VERSION}/phpMyAdmin-${PHPMYADMIN_VERSION}-all-languages.tar.gz
65
+RUN tar xfvz /tmp/phpmyadmin.tar.gz -C /var/www
66
+RUN ln -s /var/www/phpMyAdmin-${PHPMYADMIN_VERSION}-all-languages /var/www/phpmyadmin
67
+RUN mv /var/www/phpmyadmin/config.sample.inc.php /var/www/phpmyadmin/config.inc.php
68
+
69
+# Add composer
70
+RUN php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" && \
71
+    php composer-setup.php && \
72
+    php -r "unlink('composer-setup.php');" && \
73
+    mv composer.phar /usr/local/bin/composer
74
+
75
+ENV MYSQL_PASS:-$(pwgen -s 12 1)
76
+# config to enable .htaccess
77
+ADD supporting_files/apache_default /etc/apache2/sites-available/000-default.conf
78
+RUN a2enmod rewrite
79
+
80
+# Configure /app folder with sample app
81
+RUN mkdir -p /app && rm -fr /var/www/html && ln -s /app /var/www/html
82
+ADD app/ /app
83
+
84
+#Environment variables to configure php
85
+ENV PHP_UPLOAD_MAX_FILESIZE 10M
86
+ENV PHP_POST_MAX_SIZE 10M
87
+
88
+# Add volumes for the app and MySql
89
+VOLUME  ["/etc/mysql", "/var/lib/mysql", "/app" ]
90
+
91
+EXPOSE 80 3306
92
+CMD ["/run.sh"]

+ 89
- 0
symfony/docker-lamp/1404/Dockerfile-php7 View File

@@ -0,0 +1,89 @@
1
+FROM phusion/baseimage:0.9.18
2
+MAINTAINER Matthew Rayner <hello@rayner.io>
3
+ENV REFRESHED_AT 2018-08-21
4
+
5
+# based on dgraziotin/lamp
6
+# MAINTAINER Daniel Graziotin <daniel@ineed.coffee>
7
+
8
+ENV DOCKER_USER_ID 501
9
+ENV DOCKER_USER_GID 20
10
+
11
+ENV BOOT2DOCKER_ID 1000
12
+ENV BOOT2DOCKER_GID 50
13
+
14
+# Tweaks to give Apache/PHP write permissions to the app
15
+RUN usermod -u ${BOOT2DOCKER_ID} www-data && \
16
+    usermod -G staff www-data && \
17
+    useradd -r mysql && \
18
+    usermod -G staff mysql
19
+
20
+RUN groupmod -g $(($BOOT2DOCKER_GID + 10000)) $(getent group $BOOT2DOCKER_GID | cut -d: -f1)
21
+RUN groupmod -g ${BOOT2DOCKER_GID} staff
22
+
23
+# Install packages
24
+ENV DEBIAN_FRONTEND noninteractive
25
+RUN add-apt-repository -y ppa:ondrej/php && \
26
+  apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 4F4EA0AAE5267A6C && \
27
+  apt-get update && \
28
+  apt-get -y upgrade && \
29
+ apt-get -y install supervisor wget git apache2 php-xdebug libapache2-mod-php mysql-server php-mysql pwgen php-apcu php7.0-mcrypt php-gd php-xml php-mbstring php-gettext zip unzip php-zip curl php-curl && \
30
+  apt-get -y autoremove && \
31
+  echo "ServerName localhost" >> /etc/apache2/apache2.conf
32
+
33
+# needed for phpMyAdmin
34
+RUN phpenmod mcrypt
35
+
36
+# Add image configuration and scripts
37
+ADD supporting_files/start-apache2.sh /start-apache2.sh
38
+ADD supporting_files/start-mysqld.sh /start-mysqld.sh
39
+ADD supporting_files/run.sh /run.sh
40
+RUN chmod 755 /*.sh
41
+ADD supporting_files/supervisord-apache2.conf /etc/supervisor/conf.d/supervisord-apache2.conf
42
+ADD supporting_files/supervisord-mysqld.conf /etc/supervisor/conf.d/supervisord-mysqld.conf
43
+ADD supporting_files/mysqld_innodb.cnf /etc/mysql/conf.d/mysqld_innodb.cnf
44
+
45
+# Allow mysql to bind on 0.0.0.0
46
+RUN sed -i "s/.*bind-address.*/bind-address = 0.0.0.0/" /etc/mysql/my.cnf
47
+
48
+# Set PHP timezones to Europe/London
49
+RUN sed -i "s/;date.timezone =/date.timezone = Europe\/London/g" /etc/php/7.2/apache2/php.ini
50
+RUN sed -i "s/;date.timezone =/date.timezone = Europe\/London/g" /etc/php/7.2/cli/php.ini
51
+
52
+# Remove pre-installed database
53
+RUN rm -rf /var/lib/mysql
54
+
55
+# Add MySQL utils
56
+ADD supporting_files/create_mysql_users.sh /create_mysql_users.sh
57
+RUN chmod 755 /*.sh
58
+
59
+# Add phpmyadmin
60
+ENV PHPMYADMIN_VERSION=4.8.2
61
+RUN wget -O /tmp/phpmyadmin.tar.gz https://files.phpmyadmin.net/phpMyAdmin/${PHPMYADMIN_VERSION}/phpMyAdmin-${PHPMYADMIN_VERSION}-all-languages.tar.gz
62
+RUN tar xfvz /tmp/phpmyadmin.tar.gz -C /var/www
63
+RUN ln -s /var/www/phpMyAdmin-${PHPMYADMIN_VERSION}-all-languages /var/www/phpmyadmin
64
+RUN mv /var/www/phpmyadmin/config.sample.inc.php /var/www/phpmyadmin/config.inc.php
65
+
66
+# Add composer
67
+RUN php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" && \
68
+    php composer-setup.php && \
69
+    php -r "unlink('composer-setup.php');" && \
70
+    mv composer.phar /usr/local/bin/composer
71
+
72
+ENV MYSQL_PASS:-$(pwgen -s 12 1)
73
+# config to enable .htaccess
74
+ADD supporting_files/apache_default /etc/apache2/sites-available/000-default.conf
75
+RUN a2enmod rewrite
76
+
77
+# Configure /app folder with sample app
78
+RUN mkdir -p /app && rm -fr /var/www/html && ln -s /app /var/www/html
79
+ADD app/ /app
80
+
81
+#Environment variables to configure php
82
+ENV PHP_UPLOAD_MAX_FILESIZE 10M
83
+ENV PHP_POST_MAX_SIZE 10M
84
+
85
+# Add volumes for the app and MySql
86
+VOLUME  ["/etc/mysql", "/var/lib/mysql", "/app" ]
87
+
88
+EXPOSE 80 3306
89
+CMD ["/run.sh"]

+ 92
- 0
symfony/docker-lamp/1604/Dockerfile-php5 View File

@@ -0,0 +1,92 @@
1
+FROM phusion/baseimage
2
+MAINTAINER Matthew Rayner <hello@rayner.io>
3
+ENV REFRESHED_AT 2018-08-21
4
+
5
+# based on dgraziotin/lamp
6
+# MAINTAINER Daniel Graziotin <daniel@ineed.coffee>
7
+
8
+ENV DOCKER_USER_ID 501 
9
+ENV DOCKER_USER_GID 20
10
+
11
+ENV BOOT2DOCKER_ID 1000
12
+ENV BOOT2DOCKER_GID 50
13
+
14
+# Tweaks to give Apache/PHP write permissions to the app
15
+RUN usermod -u ${BOOT2DOCKER_ID} www-data && \
16
+    usermod -G staff www-data && \
17
+    useradd -r mysql && \
18
+    usermod -G staff mysql
19
+
20
+RUN groupmod -g $(($BOOT2DOCKER_GID + 10000)) $(getent group $BOOT2DOCKER_GID | cut -d: -f1)
21
+RUN groupmod -g ${BOOT2DOCKER_GID} staff
22
+
23
+# Install packages
24
+ENV DEBIAN_FRONTEND noninteractive
25
+RUN add-apt-repository -y ppa:ondrej/php && \
26
+  apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 4F4EA0AAE5267A6C && \
27
+  apt-get update && \
28
+  apt-get -y upgrade && \
29
+  apt-get -y install supervisor wget git apache2 php-xdebug libapache2-mod-php5.6 mysql-server php5.6 php5.6-mysql pwgen php5.6-apc php5.6-mcrypt php5.6-gd php5.6-xml php5.6-mbstring php5.6-gettext zip unzip php5.6-zip curl php5.6-curl && \
30
+  apt-get -y autoremove && \
31
+  echo "ServerName localhost" >> /etc/apache2/apache2.conf
32
+
33
+# Update CLI PHP to use 5.6
34
+RUN ln -sfn /usr/bin/php5.6 /etc/alternatives/php
35
+
36
+# needed for phpMyAdmin
37
+RUN phpenmod mcrypt
38
+
39
+# Add image configuration and scripts
40
+ADD supporting_files/start-apache2.sh /start-apache2.sh
41
+ADD supporting_files/start-mysqld.sh /start-mysqld.sh
42
+ADD supporting_files/run.sh /run.sh
43
+RUN chmod 755 /*.sh
44
+ADD supporting_files/supervisord-apache2.conf /etc/supervisor/conf.d/supervisord-apache2.conf
45
+ADD supporting_files/supervisord-mysqld.conf /etc/supervisor/conf.d/supervisord-mysqld.conf
46
+ADD supporting_files/mysqld_innodb.cnf /etc/mysql/conf.d/mysqld_innodb.cnf
47
+
48
+# Allow mysql to bind on 0.0.0.0
49
+RUN sed -i "s/.*bind-address.*/bind-address = 0.0.0.0/" /etc/mysql/my.cnf
50
+
51
+# Set PHP timezones to Europe/London
52
+RUN sed -i "s/;date.timezone =/date.timezone = Europe\/London/g" /etc/php/5.6/apache2/php.ini
53
+RUN sed -i "s/;date.timezone =/date.timezone = Europe\/London/g" /etc/php/5.6/cli/php.ini
54
+
55
+# Remove pre-installed database
56
+RUN rm -rf /var/lib/mysql
57
+
58
+# Add MySQL utils
59
+ADD supporting_files/create_mysql_users.sh /create_mysql_users.sh
60
+RUN chmod 755 /*.sh
61
+
62
+# Add phpmyadmin
63
+ENV PHPMYADMIN_VERSION=4.8.2
64
+RUN wget -O /tmp/phpmyadmin.tar.gz https://files.phpmyadmin.net/phpMyAdmin/${PHPMYADMIN_VERSION}/phpMyAdmin-${PHPMYADMIN_VERSION}-all-languages.tar.gz
65
+RUN tar xfvz /tmp/phpmyadmin.tar.gz -C /var/www
66
+RUN ln -s /var/www/phpMyAdmin-${PHPMYADMIN_VERSION}-all-languages /var/www/phpmyadmin
67
+RUN mv /var/www/phpmyadmin/config.sample.inc.php /var/www/phpmyadmin/config.inc.php
68
+
69
+# Add composer
70
+RUN php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" && \
71
+    php composer-setup.php && \
72
+    php -r "unlink('composer-setup.php');" && \
73
+    mv composer.phar /usr/local/bin/composer
74
+
75
+ENV MYSQL_PASS:-$(pwgen -s 12 1)
76
+# config to enable .htaccess
77
+ADD supporting_files/apache_default /etc/apache2/sites-available/000-default.conf
78
+RUN a2enmod rewrite
79
+
80
+# Configure /app folder with sample app
81
+RUN mkdir -p /app && rm -fr /var/www/html && ln -s /app /var/www/html
82
+ADD app/ /app
83
+
84
+#Environment variables to configure php
85
+ENV PHP_UPLOAD_MAX_FILESIZE 10M
86
+ENV PHP_POST_MAX_SIZE 10M
87
+
88
+# Add volumes for the app and MySql
89
+VOLUME  ["/etc/mysql", "/var/lib/mysql", "/app" ]
90
+
91
+EXPOSE 80 3306
92
+CMD ["/run.sh"]

+ 89
- 0
symfony/docker-lamp/1604/Dockerfile-php7 View File

@@ -0,0 +1,89 @@
1
+FROM phusion/baseimage
2
+MAINTAINER Matthew Rayner <hello@rayner.io>
3
+ENV REFRESHED_AT 2018-08-21
4
+
5
+# based on dgraziotin/lamp
6
+# MAINTAINER Daniel Graziotin <daniel@ineed.coffee>
7
+
8
+ENV DOCKER_USER_ID 501 
9
+ENV DOCKER_USER_GID 20
10
+
11
+ENV BOOT2DOCKER_ID 1000
12
+ENV BOOT2DOCKER_GID 50
13
+
14
+# Tweaks to give Apache/PHP write permissions to the app
15
+RUN usermod -u ${BOOT2DOCKER_ID} www-data && \
16
+    usermod -G staff www-data && \
17
+    useradd -r mysql && \
18
+    usermod -G staff mysql
19
+
20
+RUN groupmod -g $(($BOOT2DOCKER_GID + 10000)) $(getent group $BOOT2DOCKER_GID | cut -d: -f1)
21
+RUN groupmod -g ${BOOT2DOCKER_GID} staff
22
+
23
+# Install packages
24
+ENV DEBIAN_FRONTEND noninteractive
25
+RUN add-apt-repository -y ppa:ondrej/php && \
26
+  apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 4F4EA0AAE5267A6C && \
27
+  apt-get update && \
28
+  apt-get -y upgrade && \
29
+  apt-get -y install supervisor wget git apache2 php-xdebug libapache2-mod-php mysql-server php-mysql pwgen php-apcu php7.0-mcrypt php-gd php-xml php-mbstring php-gettext zip unzip php-zip curl php-curl nano subversion-tools && \
30
+  apt-get -y autoremove && \
31
+  echo "ServerName localhost" >> /etc/apache2/apache2.conf
32
+
33
+# needed for phpMyAdmin
34
+RUN phpenmod mcrypt
35
+
36
+# Add image configuration and scripts
37
+ADD supporting_files/start-apache2.sh /start-apache2.sh
38
+ADD supporting_files/start-mysqld.sh /start-mysqld.sh
39
+ADD supporting_files/run.sh /run.sh
40
+RUN chmod 755 /*.sh
41
+ADD supporting_files/supervisord-apache2.conf /etc/supervisor/conf.d/supervisord-apache2.conf
42
+ADD supporting_files/supervisord-mysqld.conf /etc/supervisor/conf.d/supervisord-mysqld.conf
43
+ADD supporting_files/mysqld_innodb.cnf /etc/mysql/conf.d/mysqld_innodb.cnf
44
+
45
+# Allow mysql to bind on 0.0.0.0
46
+RUN sed -i "s/.*bind-address.*/bind-address = 0.0.0.0/" /etc/mysql/my.cnf
47
+
48
+# Set PHP timezones to Europe/London
49
+RUN sed -i "s/;date.timezone =/date.timezone = Europe\/Paris/g" /etc/php/7.2/apache2/php.ini
50
+RUN sed -i "s/;date.timezone =/date.timezone = Europe\/Paris/g" /etc/php/7.2/cli/php.ini
51
+
52
+# Remove pre-installed database
53
+RUN rm -rf /var/lib/mysql
54
+
55
+# Add MySQL utils
56
+ADD supporting_files/create_mysql_users.sh /create_mysql_users.sh
57
+RUN chmod 755 /*.sh
58
+
59
+# Add phpmyadmin
60
+ENV PHPMYADMIN_VERSION=4.8.2
61
+RUN wget -O /tmp/phpmyadmin.tar.gz https://files.phpmyadmin.net/phpMyAdmin/${PHPMYADMIN_VERSION}/phpMyAdmin-${PHPMYADMIN_VERSION}-all-languages.tar.gz
62
+RUN tar xfvz /tmp/phpmyadmin.tar.gz -C /var/www
63
+RUN ln -s /var/www/phpMyAdmin-${PHPMYADMIN_VERSION}-all-languages /var/www/phpmyadmin
64
+RUN mv /var/www/phpmyadmin/config.sample.inc.php /var/www/phpmyadmin/config.inc.php
65
+
66
+# Add composer
67
+RUN php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" && \
68
+    php composer-setup.php && \
69
+    php -r "unlink('composer-setup.php');" && \
70
+    mv composer.phar /usr/local/bin/composer
71
+
72
+ENV MYSQL_PASS:-$(pwgen -s 12 1)
73
+# config to enable .htaccess
74
+ADD supporting_files/apache_default /etc/apache2/sites-available/000-default.conf
75
+RUN a2enmod rewrite
76
+
77
+# Configure /app folder with sample app
78
+RUN mkdir -p /app && rm -fr /var/www/html && ln -s /app /var/www/html
79
+ADD app/ /app
80
+
81
+#Environment variables to configure php
82
+ENV PHP_UPLOAD_MAX_FILESIZE 10M
83
+ENV PHP_POST_MAX_SIZE 10M
84
+
85
+# Add volumes for the app and MySql
86
+VOLUME  ["/etc/mysql", "/var/lib/mysql", "/app" ]
87
+
88
+EXPOSE 80 3306
89
+CMD ["/run.sh"]

+ 87
- 0
symfony/docker-lamp/1604/Dockerfile-php7-arm View File

@@ -0,0 +1,87 @@
1
+FROM arm64v8/ubuntu:16.04
2
+
3
+MAINTAINER Matthew Rayner <hello@rayner.io>
4
+ENV REFRESHED_AT 2018-08-21
5
+
6
+ENV DOCKER_USER_ID 501
7
+ENV DOCKER_USER_GID 20
8
+
9
+ENV BOOT2DOCKER_ID 1000
10
+ENV BOOT2DOCKER_GID 50
11
+
12
+# Tweaks to give Apache/PHP write permissions to the app
13
+RUN usermod -u ${BOOT2DOCKER_ID} www-data && \
14
+    usermod -G staff www-data && \
15
+    useradd -r mysql && \
16
+    usermod -G staff mysql
17
+
18
+RUN groupmod -g $(($BOOT2DOCKER_GID + 10000)) $(getent group $BOOT2DOCKER_GID | cut -d: -f1)
19
+RUN groupmod -g ${BOOT2DOCKER_GID} staff
20
+
21
+# Install packages
22
+ENV DEBIAN_FRONTEND noninteractive
23
+RUN apt-get update && \
24
+  apt-get install -y software-properties-common python-software-properties && \
25
+  apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 4F4EA0AAE5267A6C && \
26
+  apt-get update && \
27
+  apt-get -y upgrade && \
28
+  apt-get -y install supervisor wget git apache2 php-xdebug libapache2-mod-php mariadb-server php-mysql pwgen php-apcu php7.0-mcrypt php-gd php-xml php-mbstring php-gettext zip unzip php-zip curl php-curl && \
29
+  apt-get -y autoremove && \
30
+  echo "ServerName localhost" >> /etc/apache2/apache2.conf
31
+
32
+# needed for phpMyAdmin
33
+RUN phpenmod mcrypt
34
+
35
+# Add image configuration and scripts
36
+ADD supporting_files/start-apache2.sh /start-apache2.sh
37
+ADD supporting_files/start-mysqld.sh /start-mysqld.sh
38
+ADD supporting_files/run.sh /run.sh
39
+RUN chmod 755 /*.sh
40
+ADD supporting_files/supervisord-apache2.conf /etc/supervisor/conf.d/supervisord-apache2.conf
41
+ADD supporting_files/supervisord-mysqld.conf /etc/supervisor/conf.d/supervisord-mysqld.conf
42
+
43
+# Allow mysql to bind on 0.0.0.0
44
+RUN sed -i "s/.*bind-address.*/bind-address = 0.0.0.0/" /etc/mysql/my.cnf
45
+
46
+# Set PHP timezones to Europe/London
47
+RUN sed -i "s/;date.timezone =/date.timezone = Europe\/London/g" /etc/php/7.0/apache2/php.ini
48
+RUN sed -i "s/;date.timezone =/date.timezone = Europe\/London/g" /etc/php/7.0/cli/php.ini
49
+
50
+# Remove pre-installed database
51
+RUN rm -rf /var/lib/mysql
52
+
53
+# Add MySQL utils
54
+ADD supporting_files/create_mysql_users.sh /create_mysql_users.sh
55
+RUN chmod 755 /*.sh
56
+
57
+# Add phpmyadmin
58
+ENV PHPMYADMIN_VERSION=4.8.2
59
+RUN wget -O /tmp/phpmyadmin.tar.gz https://files.phpmyadmin.net/phpMyAdmin/${PHPMYADMIN_VERSION}/phpMyAdmin-${PHPMYADMIN_VERSION}-all-languages.tar.gz
60
+RUN tar xfvz /tmp/phpmyadmin.tar.gz -C /var/www
61
+RUN ln -s /var/www/phpMyAdmin-${PHPMYADMIN_VERSION}-all-languages /var/www/phpmyadmin
62
+RUN mv /var/www/phpmyadmin/config.sample.inc.php /var/www/phpmyadmin/config.inc.php
63
+
64
+# Add composer
65
+RUN php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" && \
66
+    php composer-setup.php && \
67
+    php -r "unlink('composer-setup.php');" && \
68
+    mv composer.phar /usr/local/bin/composer
69
+
70
+ENV MYSQL_PASS:-$(pwgen -s 12 1)
71
+# config to enable .htaccess
72
+ADD supporting_files/apache_default /etc/apache2/sites-available/000-default.conf
73
+RUN a2enmod rewrite
74
+
75
+# Configure /app folder with sample app
76
+RUN mkdir -p /app && rm -fr /var/www/html && ln -s /app /var/www/html
77
+ADD app/ /app
78
+
79
+#Environment variables to configure php
80
+ENV PHP_UPLOAD_MAX_FILESIZE 10M
81
+ENV PHP_POST_MAX_SIZE 10M
82
+
83
+# Add volumes for the app and MySql
84
+VOLUME  ["/etc/mysql", "/var/lib/mysql", "/app" ]
85
+
86
+EXPOSE 80 3306
87
+CMD ["/run.sh"]

+ 57
- 0
symfony/docker-lamp/supporting_files/apache_default View File

@@ -0,0 +1,57 @@
1
+<VirtualHost *:80>
2
+        ServerAdmin webmaster@localhost
3
+
4
+        DocumentRoot /var/www/html
5
+        <Directory />
6
+                Options Indexes FollowSymLinks MultiViews
7
+                # To make wordpress .htaccess work
8
+                AllowOverride All
9
+                Order allow,deny
10
+                allow from all
11
+        </Directory>
12
+        <Directory /var/www/html>
13
+                Options Indexes FollowSymLinks MultiViews
14
+                # To make wordpress .htaccess work
15
+                AllowOverride All
16
+                Order allow,deny
17
+                allow from all
18
+        </Directory>
19
+
20
+        Alias /phpmyadmin /var/www/phpmyadmin
21
+        <Directory /phpmyadmin>
22
+                Options Indexes FollowSymLinks MultiViews
23
+                # To make wordpress .htaccess work
24
+                AllowOverride All
25
+                Order allow,deny
26
+                allow from all
27
+        </Directory>
28
+        <Directory /var/www/phpmyadmin>
29
+                Options Indexes FollowSymLinks MultiViews
30
+                # To make wordpress .htaccess work
31
+                AllowOverride All
32
+                Order allow,deny
33
+                allow from all
34
+        </Directory>
35
+
36
+        ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
37
+        <Directory "/usr/lib/cgi-bin">
38
+                AllowOverride None
39
+                Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
40
+                Order allow,deny
41
+                Allow from all
42
+        </Directory>
43
+
44
+        ErrorLog ${APACHE_LOG_DIR}/error.log
45
+
46
+        # Possible values include: debug, info, notice, warn, error, crit,
47
+        # alert, emerg.
48
+        LogLevel warn
49
+
50
+        CustomLog ${APACHE_LOG_DIR}/access.log combined
51
+
52
+	#
53
+	# Set HTTPS environment variable if we came in over secure
54
+	#  channel.
55
+	SetEnvIf x-forwarded-proto https HTTPS=on
56
+
57
+</VirtualHost>

+ 63
- 0
symfony/docker-lamp/supporting_files/create_mysql_users.sh View File

@@ -0,0 +1,63 @@
1
+#!/bin/bash
2
+
3
+/usr/bin/mysqld_safe > /dev/null 2>&1 &
4
+
5
+RET=1
6
+while [[ RET -ne 0 ]]; do
7
+    echo "=> Waiting for confirmation of MySQL service startup"
8
+    sleep 5
9
+    mysql -uroot -e "status" > /dev/null 2>&1
10
+    RET=$?
11
+done
12
+
13
+PASS=${MYSQL_ADMIN_PASS:-$(pwgen -s 12 1)}
14
+_word=$( [ ${MYSQL_ADMIN_PASS} ] && echo "preset" || echo "random" )
15
+echo "=> Creating MySQL admin user with ${_word} password"
16
+
17
+mysql -uroot -e "CREATE USER 'admin'@'%' IDENTIFIED BY '$PASS'"
18
+mysql -uroot -e "GRANT ALL PRIVILEGES ON *.* TO 'admin'@'%' WITH GRANT OPTION"
19
+
20
+mysql -uroot -e " GRANT ALL PRIVILEGES ON phpmyadmin.* TO  'pma'@'localhost' IDENTIFIED BY ''"
21
+
22
+CREATE_MYSQL_USER=false
23
+
24
+if [ -n "$CREATE_MYSQL_BASIC_USER_AND_DB" ] || \
25
+   [ -n "$MYSQL_USER_NAME" ] || \
26
+   [ -n "$MYSQL_USER_DB" ] || \
27
+   [ -n "$MYSQL_USER_PASS" ]; then
28
+      CREATE_MYSQL_USER=true
29
+fi
30
+
31
+if [ "$CREATE_MYSQL_USER" = true ]; then
32
+    _user=${MYSQL_USER_NAME:-user}
33
+    _userdb=${MYSQL_USER_DB:-db}
34
+    _userpass=${MYSQL_USER_PASS:-password}
35
+
36
+    mysql -uroot -e "CREATE USER '${_user}'@'%' IDENTIFIED BY  '${_userpass}'"
37
+    mysql -uroot -e "GRANT USAGE ON *.* TO  '${_user}'@'%' IDENTIFIED BY '${_userpass}'"
38
+    mysql -uroot -e "CREATE DATABASE IF NOT EXISTS ${_userdb}"
39
+    mysql -uroot -e "GRANT ALL PRIVILEGES ON ${_userdb}.* TO '${_user}'@'%'"
40
+fi
41
+
42
+echo "=> Done!"
43
+
44
+echo "========================================================================"
45
+echo "You can now connect to this MySQL Server with $PASS"
46
+echo ""
47
+echo "    mysql -uadmin -p$PASS -h<host> -P<port>"
48
+echo ""
49
+echo "Please remember to change the above password as soon as possible!"
50
+echo "MySQL user 'root' has no password but only allows local connections"
51
+echo ""
52
+
53
+if [ "$CREATE_MYSQL_USER" = true ]; then
54
+    echo "We also created"
55
+    echo "A database called '${_userdb}' and"
56
+    echo "a user called '${_user}' with password '${_userpass}'"
57
+    echo "'${_user}' has full access on '${_userdb}'"
58
+fi
59
+
60
+echo "enjoy!"
61
+echo "========================================================================"
62
+
63
+mysqladmin -uroot shutdown

+ 5
- 0
symfony/docker-lamp/supporting_files/mysqld_innodb.cnf View File

@@ -0,0 +1,5 @@
1
+[mysqld]
2
+server-id=1
3
+innodb_flush_method=O_DSYNC
4
+innodb-use-native-aio=0
5
+log_bin=ON

+ 75
- 0
symfony/docker-lamp/supporting_files/run.sh View File

@@ -0,0 +1,75 @@
1
+#!/bin/bash
2
+
3
+VOLUME_HOME="/var/lib/mysql"
4
+
5
+if [ -e /etc/php/5.6/apache2/php.ini ]
6
+then
7
+    sed -ri -e "s/^upload_max_filesize.*/upload_max_filesize = ${PHP_UPLOAD_MAX_FILESIZE}/" \
8
+        -e "s/^post_max_size.*/post_max_size = ${PHP_POST_MAX_SIZE}/" /etc/php/5.6/apache2/php.ini
9
+else
10
+    sed -ri -e "s/^upload_max_filesize.*/upload_max_filesize = ${PHP_UPLOAD_MAX_FILESIZE}/" \
11
+        -e "s/^post_max_size.*/post_max_size = ${PHP_POST_MAX_SIZE}/" /etc/php/7.2/apache2/php.ini
12
+fi
13
+
14
+
15
+sed -i "s/export APACHE_RUN_GROUP=www-data/export APACHE_RUN_GROUP=staff/" /etc/apache2/envvars
16
+
17
+if [ -n "$APACHE_ROOT" ];then
18
+    rm -f /var/www/html && ln -s "/app/${APACHE_ROOT}" /var/www/html
19
+fi
20
+
21
+sed -i -e "s/cfg\['blowfish_secret'\] = ''/cfg['blowfish_secret'] = '`date | md5sum`'/" /var/www/phpmyadmin/config.inc.php
22
+
23
+mkdir -p /var/run/mysqld
24
+
25
+if [ -n "$VAGRANT_OSX_MODE" ];then
26
+    usermod -u $DOCKER_USER_ID www-data
27
+    groupmod -g $(($DOCKER_USER_GID + 10000)) $(getent group $DOCKER_USER_GID | cut -d: -f1)
28
+    groupmod -g ${DOCKER_USER_GID} staff
29
+    chmod -R 770 /var/lib/mysql
30
+    chmod -R 770 /var/run/mysqld
31
+    chown -R www-data:staff /var/lib/mysql
32
+    chown -R www-data:staff /var/run/mysqld
33
+else
34
+    # Tweaks to give Apache/PHP write permissions to the app
35
+    chown -R www-data:staff /var/www
36
+    chown -R www-data:staff /app
37
+    chown -R www-data:staff /var/lib/mysql
38
+    chown -R www-data:staff /var/run/mysqld
39
+    chmod -R 770 /var/lib/mysql
40
+    chmod -R 770 /var/run/mysqld
41
+fi
42
+
43
+rm /var/run/mysqld/mysqld.sock
44
+
45
+sed -i "s/bind-address.*/bind-address = 0.0.0.0/" /etc/mysql/my.cnf
46
+sed -i "s/user.*/user = www-data/" /etc/mysql/my.cnf
47
+
48
+if [[ ! -d $VOLUME_HOME/mysql ]]; then
49
+    echo "=> An empty or uninitialized MySQL volume is detected in $VOLUME_HOME"
50
+    echo "=> Installing MySQL ..."
51
+
52
+    # Try the 'preferred' solution
53
+    mysqld --initialize-insecure > /dev/null 2>&1
54
+
55
+    # IF that didn't work
56
+    if [ $? -ne 0 ]; then
57
+        # Fall back to the 'depreciated' solution
58
+        mysql_install_db > /dev/null 2>&1
59
+    fi
60
+
61
+    echo "=> Done!"  
62
+    /create_mysql_users.sh
63
+else
64
+    echo "=> Using an existing volume of MySQL"
65
+fi
66
+
67
+#DNS Negocia for svn
68
+if grep -q "nameserver 192.168.30.254" /etc/resolv.conf; then
69
+    echo "DNS negocia OK"
70
+else
71
+    echo "Modification DNS negocia"
72
+    echo "nameserver 192.168.30.254" > /etc/resolv.conf
73
+fi
74
+
75
+exec supervisord -n

+ 3
- 0
symfony/docker-lamp/supporting_files/start-apache2.sh View File

@@ -0,0 +1,3 @@
1
+#!/bin/bash
2
+source /etc/apache2/envvars
3
+exec apache2 -D FOREGROUND

+ 2
- 0
symfony/docker-lamp/supporting_files/start-mysqld.sh View File

@@ -0,0 +1,2 @@
1
+#!/bin/bash
2
+exec mysqld_safe

+ 5
- 0
symfony/docker-lamp/supporting_files/supervisord-apache2.conf View File

@@ -0,0 +1,5 @@
1
+[program:apache2]
2
+command=/start-apache2.sh
3
+numprocs=1
4
+autostart=true
5
+autorestart=true

+ 5
- 0
symfony/docker-lamp/supporting_files/supervisord-mysqld.conf View File

@@ -0,0 +1,5 @@
1
+[program:mysqld]
2
+command=/start-mysqld.sh
3
+numprocs=1
4
+autostart=true
5
+autorestart=true

+ 6
- 0
symfony/docker-lamp/tests/1404.sh View File

@@ -0,0 +1,6 @@
1
+#!/bin/bash
2
+source _helpers.sh
3
+
4
+testimage 1404-php5 web1404-php5
5
+
6
+testimage 1404-php7 web1404-php7

+ 6
- 0
symfony/docker-lamp/tests/1604.sh View File

@@ -0,0 +1,6 @@
1
+#!/bin/bash
2
+source _helpers.sh
3
+
4
+testimage 1604-php5 web1604-php5
5
+
6
+testimage 1604-php7 web1604-php7

+ 19
- 0
symfony/docker-lamp/tests/Dockerfile.test View File

@@ -0,0 +1,19 @@
1
+FROM phusion/baseimage
2
+MAINTAINER Matthew Rayner <matt@mattrayner.co.uk>
3
+
4
+RUN apt-get update && apt-get install -yq curl && apt-get clean
5
+
6
+WORKDIR /app
7
+
8
+COPY test.sh /app/test.sh
9
+COPY 1404.sh /app/1404.sh
10
+COPY 1604.sh /app/1604.sh
11
+COPY _helpers.sh /app/_helpers.sh
12
+COPY expected/1404-php5.html /app/expected/1404-php5.html
13
+COPY expected/1404-php7.html /app/expected/1404-php7.html
14
+COPY expected/1604-php5.html /app/expected/1604-php5.html
15
+COPY expected/1604-php7.html /app/expected/1604-php7.html
16
+
17
+RUN mkdir -p actual/
18
+
19
+CMD ["bash", "test.sh"]

+ 22
- 0
symfony/docker-lamp/tests/_helpers.sh View File

@@ -0,0 +1,22 @@
1
+#!/bin/bash
2
+# Echo success or cause an exit if the value passed != 0
3
+function checkstatus {
4
+    if [ $1 -eq 0 ]; then
5
+        echo "=> Success"
6
+    else
7
+        echo "=> Failed"
8
+        exit $1
9
+    fi
10
+}
11
+
12
+# Test our image, first curling our container and then checking the result against our expectations
13
+function testimage {
14
+    echo "=> Querying image ($1)"
15
+    curl --retry 10 --retry-delay 5 -o actual/$1.html $2 --stderr -
16
+    checkstatus $?
17
+
18
+    echo "=> Checking against expected values ($1)"
19
+    diff -b actual/$1.html expected/$1.html
20
+    checkstatus $?
21
+    echo
22
+}

+ 54
- 0
symfony/docker-lamp/tests/expected/1404-php5.html View File

@@ -0,0 +1,54 @@
1
+<!doctype html>
2
+<html lang=en>
3
+<head>
4
+    <meta charset=utf-8>
5
+    <title>Hello World from Docker-LAMP</title>
6
+
7
+    <style>
8
+        @import 'https://fonts.googleapis.com/css?family=Montserrat|Raleway|Source+Code+Pro';
9
+
10
+        body { font-family: 'Raleway', sans-serif; }
11
+        h2 { font-family: 'Montserrat', sans-serif; }
12
+        pre {
13
+            font-family: 'Source Code Pro', monospace;
14
+
15
+            padding: 16px;
16
+            overflow: auto;
17
+            font-size: 85%;
18
+            line-height: 1.45;
19
+            background-color: #f7f7f7;
20
+            border-radius: 3px;
21
+
22
+            word-wrap: normal;
23
+        }
24
+
25
+        .container {
26
+            max-width: 1024px;
27
+            width: 100%;
28
+            margin: 0 auto;
29
+        }
30
+    </style>
31
+</head>
32
+<body>
33
+    <div class="container">
34
+        <header>
35
+            <img src="https://cdn.rawgit.com/mattrayner/docker-lamp/831976c022782e592b7e2758464b2a9efe3da042/docs/logo.svg" alt="Docker LAMP logo" />
36
+            <h2>Welcome to <a href="https://github.com/mattrayner/docker-lamp" target="_blank">Docker-Lamp</a> a.k.a mattrayner/lamp</h2>
37
+        </header>
38
+        <article>
39
+            <p>
40
+                For documentation, <a href="https://github.com/mattrayner/docker-lamp" target="_blank">click here</a>.
41
+            </p>
42
+        </article>
43
+        <section>
44
+            <pre>
45
+OS: Linux<br/>
46
+Apache: Apache/2.4.7 (Ubuntu)<br/>
47
+MySQL Version: 5.5.61-0ubuntu0.14.04.1-log<br/>
48
+PHP Version: 5.6.37-1+ubuntu14.04.1+deb.sury.org+1<br/>
49
+phpMyAdmin Version: 4.8.2<span>&nbsp;</span>
50
+            </pre>
51
+        </section>
52
+    </div>
53
+</body>
54
+</html>

+ 54
- 0
symfony/docker-lamp/tests/expected/1404-php7.html View File

@@ -0,0 +1,54 @@
1
+<!doctype html>
2
+<html lang=en>
3
+<head>
4
+    <meta charset=utf-8>
5
+    <title>Hello World from Docker-LAMP</title>
6
+
7
+    <style>
8
+        @import 'https://fonts.googleapis.com/css?family=Montserrat|Raleway|Source+Code+Pro';
9
+
10
+        body { font-family: 'Raleway', sans-serif; }
11
+        h2 { font-family: 'Montserrat', sans-serif; }
12
+        pre {
13
+            font-family: 'Source Code Pro', monospace;
14
+
15
+            padding: 16px;
16
+            overflow: auto;
17
+            font-size: 85%;
18
+            line-height: 1.45;
19
+            background-color: #f7f7f7;
20
+            border-radius: 3px;
21
+
22
+            word-wrap: normal;
23
+        }
24
+
25
+        .container {
26
+            max-width: 1024px;
27
+            width: 100%;
28
+            margin: 0 auto;
29
+        }
30
+    </style>
31
+</head>
32
+<body>
33
+    <div class="container">
34
+        <header>
35
+            <img src="https://cdn.rawgit.com/mattrayner/docker-lamp/831976c022782e592b7e2758464b2a9efe3da042/docs/logo.svg" alt="Docker LAMP logo" />
36
+            <h2>Welcome to <a href="https://github.com/mattrayner/docker-lamp" target="_blank">Docker-Lamp</a> a.k.a mattrayner/lamp</h2>
37
+        </header>
38
+        <article>
39
+            <p>
40
+                For documentation, <a href="https://github.com/mattrayner/docker-lamp" target="_blank">click here</a>.
41
+            </p>
42
+        </article>
43
+        <section>
44
+            <pre>
45
+OS: Linux<br/>
46
+Apache: Apache/2.4.7 (Ubuntu)<br/>
47
+MySQL Version: 5.5.61-0ubuntu0.14.04.1-log<br/>
48
+PHP Version: 7.2.9-1+ubuntu14.04.1+deb.sury.org+1<br/>
49
+phpMyAdmin Version: 4.8.2<span>&nbsp;</span>
50
+            </pre>
51
+        </section>
52
+    </div>
53
+</body>
54
+</html>

+ 54
- 0
symfony/docker-lamp/tests/expected/1604-php5.html View File

@@ -0,0 +1,54 @@
1
+<!doctype html>
2
+<html lang=en>
3
+<head>
4
+    <meta charset=utf-8>
5
+    <title>Hello World from Docker-LAMP</title>
6
+
7
+    <style>
8
+        @import 'https://fonts.googleapis.com/css?family=Montserrat|Raleway|Source+Code+Pro';
9
+
10
+        body { font-family: 'Raleway', sans-serif; }
11
+        h2 { font-family: 'Montserrat', sans-serif; }
12
+        pre {
13
+            font-family: 'Source Code Pro', monospace;
14
+
15
+            padding: 16px;
16
+            overflow: auto;
17
+            font-size: 85%;
18
+            line-height: 1.45;
19
+            background-color: #f7f7f7;
20
+            border-radius: 3px;
21
+
22
+            word-wrap: normal;
23
+        }
24
+
25
+        .container {
26
+            max-width: 1024px;
27
+            width: 100%;
28
+            margin: 0 auto;
29
+        }
30
+    </style>
31
+</head>
32
+<body>
33
+    <div class="container">
34
+        <header>
35
+            <img src="https://cdn.rawgit.com/mattrayner/docker-lamp/831976c022782e592b7e2758464b2a9efe3da042/docs/logo.svg" alt="Docker LAMP logo" />
36
+            <h2>Welcome to <a href="https://github.com/mattrayner/docker-lamp" target="_blank">Docker-Lamp</a> a.k.a mattrayner/lamp</h2>
37
+        </header>
38
+        <article>
39
+            <p>
40
+                For documentation, <a href="https://github.com/mattrayner/docker-lamp" target="_blank">click here</a>.
41
+            </p>
42
+        </article>
43
+        <section>
44
+            <pre>
45
+OS: Linux<br/>
46
+Apache: Apache/2.4.18 (Ubuntu)<br/>
47
+MySQL Version: 5.7.23-0ubuntu0.16.04.1-log<br/>
48
+PHP Version: 5.6.37-1+ubuntu16.04.1+deb.sury.org+1<br/>
49
+phpMyAdmin Version: 4.8.2<span>&nbsp;</span>
50
+            </pre>
51
+        </section>
52
+    </div>
53
+</body>
54
+</html>

+ 54
- 0
symfony/docker-lamp/tests/expected/1604-php7.html View File

@@ -0,0 +1,54 @@
1
+<!doctype html>
2
+<html lang=en>
3
+<head>
4
+    <meta charset=utf-8>
5
+    <title>Hello World from Docker-LAMP</title>
6
+
7
+    <style>
8
+        @import 'https://fonts.googleapis.com/css?family=Montserrat|Raleway|Source+Code+Pro';
9
+
10
+        body { font-family: 'Raleway', sans-serif; }
11
+        h2 { font-family: 'Montserrat', sans-serif; }
12
+        pre {
13
+            font-family: 'Source Code Pro', monospace;
14
+
15
+            padding: 16px;
16
+            overflow: auto;
17
+            font-size: 85%;
18
+            line-height: 1.45;
19
+            background-color: #f7f7f7;
20
+            border-radius: 3px;
21
+
22
+            word-wrap: normal;
23
+        }
24
+
25
+        .container {
26
+            max-width: 1024px;
27
+            width: 100%;
28
+            margin: 0 auto;
29
+        }
30
+    </style>
31
+</head>
32
+<body>
33
+    <div class="container">
34
+        <header>
35
+            <img src="https://cdn.rawgit.com/mattrayner/docker-lamp/831976c022782e592b7e2758464b2a9efe3da042/docs/logo.svg" alt="Docker LAMP logo" />
36
+            <h2>Welcome to <a href="https://github.com/mattrayner/docker-lamp" target="_blank">Docker-Lamp</a> a.k.a mattrayner/lamp</h2>
37
+        </header>
38
+        <article>
39
+            <p>
40
+                For documentation, <a href="https://github.com/mattrayner/docker-lamp" target="_blank">click here</a>.
41
+            </p>
42
+        </article>
43
+        <section>
44
+            <pre>
45
+OS: Linux<br/>
46
+Apache: Apache/2.4.18 (Ubuntu)<br/>
47
+MySQL Version: 5.7.23-0ubuntu0.16.04.1-log<br/>
48
+PHP Version: 7.2.9-1+ubuntu16.04.1+deb.sury.org+1<br/>
49
+phpMyAdmin Version: 4.8.2<span>&nbsp;</span>
50
+            </pre>
51
+        </section>
52
+    </div>
53
+</body>
54
+</html>

+ 14
- 0
symfony/docker-lamp/tests/test.sh View File

@@ -0,0 +1,14 @@
1
+#!/bin/bash
2
+source _helpers.sh
3
+
4
+echo
5
+echo "Testing mattrayner/lamp"
6
+echo "=> Sleeping to allow boot of containers"
7
+sleep 15
8
+
9
+echo
10
+echo "=> Testing 16.04 images"
11
+. 1604.sh
12
+
13
+echo "=> Testing 14.04 images"
14
+. 1404.sh

Loading…
Cancel
Save