6fa7d164 by Insu Mun

Add docker files.

1 parent 8fcce10f
1 web:
2 build: docker/web
3 ports:
4 - "9090:80"
5 volumes:
6 - ./:/var/www/html
1 FROM php:5.6-apache
2
3 # Enable apache mods.
4 RUN a2enmod php5
5 RUN a2enmod rewrite
6
7 # Manually set up the apache environment variables
8 ENV APACHE_RUN_USER www-data
9 ENV APACHE_RUN_GROUP www-data
10 ENV APACHE_LOG_DIR /var/log/apache2
11 ENV APACHE_LOCK_DIR /var/lock/apache2
12 ENV APACHE_PID_FILE /var/run/apache2.pid
13
14 # Update the default apache site with the config we created.
15 ADD apache-config.conf /etc/apache2/sites-available/000-default.conf
16 RUN a2ensite 000-default
...\ No newline at end of file ...\ No newline at end of file
1 <VirtualHost *:80>
2 ServerAdmin me@mydomain.com
3 DocumentRoot /var/www/html
4
5 <Directory /var/www/html/>
6 Options Indexes FollowSymLinks MultiViews
7 AllowOverride All
8 Require all granted
9 </Directory>
10
11 ErrorLog ${APACHE_LOG_DIR}/error.log
12 CustomLog ${APACHE_LOG_DIR}/access.log combined
13
14 </VirtualHost>
...\ No newline at end of file ...\ No newline at end of file
1 #!/bin/bash
2 set -e
3
4 ext="$1"
5 extDir="/usr/src/php/ext/$ext"
6 if [ -z "$ext" -o ! -d "$extDir" ]; then
7 echo >&2 "usage: $0 ext-name [configure flags]"
8 echo >&2 " ie: $0 gd --with-jpeg-dir=/usr/local/something"
9 echo >&2
10 echo >&2 'Possible values for ext-name:'
11 echo >&2 $(find /usr/src/php/ext -mindepth 2 -maxdepth 2 -type f$
12 exit 1
13 fi
14 shift
15
16 set -x
17 cd "$extDir"
18 phpize
19 ./configure "$@"
...\ No newline at end of file ...\ No newline at end of file
1 #!/bin/bash
2 set -e
3
4 cd /usr/src/php/ext
5
6 usage() {
7 echo "usage: $0 ext-name [ext-name ...]"
8 echo " ie: $0 gd mysqli"
9 echo " $0 pdo pdo_mysql"
10 echo
11 echo 'if custom ./configure arguments are necessary, see docker-$
12 echo
13 echo 'Possible values for ext-name:'
14 echo $(find /usr/src/php/ext -mindepth 2 -maxdepth 2 -type f -na$
15 }
16
17 exts=()
18 while [ $# -gt 0 ]; do
19 ext="$1"
20 shift
21 if [ -z "$ext" ]; then
22 continue
23 fi
24 if [ ! -d "$ext" ]; then
25 echo >&2 "error: $(pwd -P)/$ext does not exist"
26 echo >&2
27 usage >&2
28 exit 1
29 fi
30 exts+=( "$ext" )
31 done
32
33 if [ "${#exts[@]}" -eq 0 ]; then
34 usage >&2
35 exit 1
36 fi
37
38 for ext in "${exts[@]}"; do
39 (
40 cd "$ext"
41 [ -e Makefile ] || docker-php-ext-configure "$ext"
42 make
43 make install
44 ini="/usr/local/etc/php/conf.d/docker-php-ext-$ext.ini"
45 for module in modules/*.so; do
46 if [ -f "$module" ]; then
47 if grep -q zend_extension_entry "$module$
48 # https://wiki.php.net/internals$
49 line="zend_extension=$(basename $
50 else
51 line="extension=$(basename "$mod$
52 fi
53 if ! grep -q "$line" "$ini"; then
54 echo "$line" >> "/usr/local/etc/$
55 fi
56 fi
57 done
58 make clean
59 )
60 done
...\ No newline at end of file ...\ No newline at end of file
1 <?php 1 <?php
2 session_start(); 2 session_start();
3 $db = new mysqli('localhost', 'root', 'root'); 3 // $db = new mysqli('localhost', 'root', 'root');
4 ?> 4 ?>
5 5
6 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 6 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
......