Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 3d7e388

Browse files
committed
intial commit
1 parent 6ca7210 commit 3d7e388

File tree

5 files changed

+94
-0
lines changed

5 files changed

+94
-0
lines changed

‎Dockerfile‎

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
FROM ubuntu:16.04
2+
3+
RUN apt-get update && \
4+
apt-get dist-upgrade -y && \
5+
apt-get install -y \
6+
apache2 \
7+
php7.0 \
8+
php7.0-cli \
9+
libapache2-mod-php7.0 \
10+
php-apcu \
11+
php-xdebug \
12+
php7.0-gd \
13+
php7.0-json \
14+
php7.0-ldap \
15+
php7.0-mbstring \
16+
php7.0-mysql \
17+
php7.0-pgsql \
18+
php7.0-sqlite3 \
19+
php7.0-xml \
20+
php7.0-xsl \
21+
php7.0-zip \
22+
php7.0-soap \
23+
php7.0-opcache \
24+
composer \
25+
curl
26+
27+
COPY apache-config.conf /etc/apache2/sites-available/000-default.conf
28+
COPY run /usr/local/bin/run
29+
RUN chmod +x /usr/local/bin/run
30+
RUN a2enmod rewrite
31+
32+
RUN cd /tmp && curl -sS https://getcomposer.org/installer | php && mv composer.phar /usr/local/bin/composer
33+
34+
# Update the PHP.ini file, enable <? ?> tags and quieten logging.
35+
RUN sed -i "s/short_open_tag = Off/short_open_tag = On/" /etc/php/7.0/apache2/php.ini
36+
RUN sed -i "s/error_reporting = .*$/error_reporting = E_ERROR | E_WARNING | E_PARSE/" /etc/php/7.0/apache2/php.ini
37+
38+
39+
ADD composer.json /php-composer/
40+
WORKDIR /php-composer/
41+
RUN /usr/local/bin/composer update
42+
43+
ADD src /var/www/
44+
WORKDIR /var/www/
45+
46+
47+
EXPOSE 80
48+
CMD ["/usr/local/bin/run"]

‎apache-config.conf‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<VirtualHost *:80>
2+
ServerAdmin webmaster@localhost
3+
DocumentRoot /var/www
4+
5+
<Directory /var/www>
6+
AllowOverride All
7+
Require all granted
8+
</Directory>
9+
10+
ErrorLog /dev/stdout
11+
CustomLog /dev/stdout combined
12+
13+
</VirtualHost>

‎composer.json‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"name": "php-app",
3+
"license": "Apache-2.0",
4+
"authors": [
5+
{
6+
"name": "Ali Ikram"
7+
}
8+
],
9+
"require": {
10+
"php": ">=5.5",
11+
"aws/aws-sdk-php": "^3.2.6"
12+
},
13+
"require-dev": {
14+
"phpunit/phpunit": "^4.8.35|^5.4.0|^6.0.0"
15+
}
16+
}

‎run‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/bin/bash
2+
set -e
3+
4+
PHP_ERROR_REPORTING=${PHP_ERROR_REPORTING:-"E_ALL"}
5+
sed -ri 's/^display_errors\s*=\s*Off/display_errors = On/g' /etc/php/7.0/apache2/php.ini
6+
sed -ri 's/^display_errors\s*=\s*Off/display_errors = On/g' /etc/php/7.0/cli/php.ini
7+
sed -ri "s/^error_reporting\s*=.*$//g" /etc/php/7.0/apache2/php.ini
8+
sed -ri "s/^error_reporting\s*=.*$//g" /etc/php/7.0/cli/php.ini
9+
echo "error_reporting = $PHP_ERROR_REPORTING" >> /etc/php/7.0/apache2/php.ini
10+
echo "error_reporting = $PHP_ERROR_REPORTING" >> /etc/php/7.0/cli/php.ini
11+
12+
# Apache gets grumpy about PID files pre-existing, so remove them:
13+
rm -f /var/run/apache2/apache2.pid
14+
source /etc/apache2/envvars && exec /usr/sbin/apache2 -DFOREGROUND

‎src/index.php‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<?php echo "<p>Hello Docker PHP Developer!!!</p>"; ?>
2+
3+
<? phpinfo();?>

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /