Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit feb1841

Browse files
committed
Better directory structure for multiple php version
1 parent 39919ad commit feb1841

File tree

11 files changed

+106
-1
lines changed

11 files changed

+106
-1
lines changed

5.4/.DS_Store

6 KB
Binary file not shown.

5.4/Dockerfile

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
FROM debian:wheezy
2+
3+
MAINTAINER Joeri Verdeyen <[email protected]>
4+
5+
ENV DOCUMENT_ROOT /var/www/app/html
6+
ENV ENVIRONMENT dev
7+
8+
RUN \
9+
apt-get update && \
10+
apt-get install -y \
11+
apache2 \
12+
php5 \
13+
php5-mysql \
14+
php5-mysql \
15+
php5-mcrypt \
16+
php5-gd \
17+
php5-memcached \
18+
php5-curl \
19+
php-pear \
20+
php-apc \
21+
php5-cli \
22+
php5-curl \
23+
php5-mcrypt \
24+
php5-sqlite \
25+
php5-intl \
26+
php5-tidy \
27+
php5-imap \
28+
php5-imagick \
29+
php5-json \
30+
php5-imagick \
31+
libapache2-mod-php5 && \
32+
a2enmod proxy && \
33+
a2enmod proxy_http && \
34+
a2enmod alias && \
35+
a2enmod dir && \
36+
a2enmod env && \
37+
a2enmod mime && \
38+
a2enmod reqtimeout && \
39+
a2enmod rewrite && \
40+
a2enmod status && \
41+
a2enmod filter && \
42+
a2enmod deflate && \
43+
a2enmod setenvif && \
44+
a2enmod vhost_alias && \
45+
a2enmod ssl && \
46+
apt-get autoremove -y && \
47+
apt-get clean && \
48+
rm -rf /var/lib/apt/lists
49+
50+
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
51+
52+
RUN echo Europe/Brussels > /etc/timezone && dpkg-reconfigure --frontend noninteractive tzdata
53+
54+
RUN ln -sf /dev/stderr /var/log/apache2/error.log
55+
56+
COPY default.conf /etc/apache2/sites-available/000-default.conf
57+
COPY php.ini /etc/php5/apache2/conf.d/
58+
COPY php.ini /etc/php5/cli/conf.d/
59+
COPY run.sh run.sh
60+
61+
RUN chmod +x run.sh
62+
63+
EXPOSE 80
64+
65+
CMD ["./run.sh"]

default.conf renamed to 5.4/default.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
ErrorLog /var/log/apache2/error.log
66
CustomLog /var/log/apache2/access.log combined
77

8-
SetEnv ENVIRONMENT dev
8+
SetEnv ENVIRONMENT ENVIRONMENT_VAR
99

1010
<Directory "DOCUMENT_ROOT">
1111
Options +SymLinksIfOwnerMatch

php.ini renamed to 5.4/php.ini

File renamed without changes.

run.sh renamed to 5.4/run.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#!/bin/bash
22

33
sed -i "s|DOCUMENT_ROOT|$DOCUMENT_ROOT|g" /etc/apache2/sites-available/000-default.conf && \
4+
sed -i "s|ENVIRONMENT_VAR|$ENVIRONMENT|g" /etc/apache2/sites-available/000-default.conf && \
45
/usr/sbin/apache2ctl -D FOREGROUND

5.6/.DS_Store

6 KB
Binary file not shown.

Dockerfile renamed to 5.6/Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ FROM debian:jessie
33
MAINTAINER Joeri Verdeyen <[email protected]>
44

55
ENV DOCUMENT_ROOT /var/www/app/html
6+
ENV ENVIRONMENT dev
67

78
RUN \
89
apt-get update && \

5.6/default.conf

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<VirtualHost *:80>
2+
3+
DocumentRoot DOCUMENT_ROOT
4+
5+
ErrorLog /var/log/apache2/error.log
6+
CustomLog /var/log/apache2/access.log combined
7+
8+
SetEnv ENVIRONMENT ENVIRONMENT_VAR
9+
10+
<Directory "DOCUMENT_ROOT">
11+
Options +SymLinksIfOwnerMatch
12+
AllowOverride AuthConfig FileInfo Indexes Limit Options=Indexes,MultiViews
13+
Require all granted
14+
</Directory>
15+
16+
</VirtualHost>

5.6/php.ini

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
date.timezone = Europe/Brussels
2+
include_path = ".:/usr/share/php:/var/www/libs/cake1.2"
3+
4+
log_errors = 1
5+
display_errors = 0
6+
error_log = /var/log/error.log
7+
memory_limit = 2048M
8+
error_reporting = E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED

5.6/run.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/bash
2+
3+
sed -i "s|DOCUMENT_ROOT|$DOCUMENT_ROOT|g" /etc/apache2/sites-available/000-default.conf && \
4+
sed -i "s|ENVIRONMENT_VAR|$ENVIRONMENT|g" /etc/apache2/sites-available/000-default.conf && \
5+
/usr/sbin/apache2ctl -D FOREGROUND

0 commit comments

Comments
 (0)