adding pluie/alpine-apache-php7
This commit is contained in:
parent
0dd7c33a71
commit
b92bff465d
|
@ -5,6 +5,7 @@
|
||||||
- [pluie/alpine-apache][3] ( ~ 50 MB ) Apache/2.4.23 Php/5.6.24
|
- [pluie/alpine-apache][3] ( ~ 50 MB ) Apache/2.4.23 Php/5.6.24
|
||||||
- [pluie/alpine-apache-fpm][7] ( ~ 50 MB ) Apache/2.4.23 Php/5.6.24 Fpm
|
- [pluie/alpine-apache-fpm][7] ( ~ 50 MB ) Apache/2.4.23 Php/5.6.24 Fpm
|
||||||
- [pluie/alpine-symfony][6] ( ~ 82 MB ) Symfony2.8 or 3.1
|
- [pluie/alpine-symfony][6] ( ~ 82 MB ) Symfony2.8 or 3.1
|
||||||
|
- [pluie/alpine-apache-php7][8] ( ~ 50 MB ) Apache/2.4.25 Php/7.0.15
|
||||||
- [pluie/alpine-mysql][4] ( ~172 MB ) MariaDb/10.1.14
|
- [pluie/alpine-mysql][4] ( ~172 MB ) MariaDb/10.1.14
|
||||||
- [docker tips][5]
|
- [docker tips][5]
|
||||||
|
|
||||||
|
@ -162,3 +163,4 @@ docker run --name symfony --restart=always \
|
||||||
[7]: https://github.com/pluie-org/docker-images/tree/master/pluie/alpine-apache-fpm
|
[7]: https://github.com/pluie-org/docker-images/tree/master/pluie/alpine-apache-fpm
|
||||||
[5]: https://github.com/pluie-org/docker-images/blob/master/DOCKER.md
|
[5]: https://github.com/pluie-org/docker-images/blob/master/DOCKER.md
|
||||||
[6]: https://github.com/pluie-org/docker-images/tree/master/pluie/alpine-symfony
|
[6]: https://github.com/pluie-org/docker-images/tree/master/pluie/alpine-symfony
|
||||||
|
[8]: https://github.com/pluie-org/docker-images/tree/master/pluie/7alpine-php
|
||||||
|
|
|
@ -9,6 +9,7 @@ various based images for Docker
|
||||||
- [pluie/alpine-apache][3] ( ~ 50 MB ) Apache/2.4.23 Php/5.6.24
|
- [pluie/alpine-apache][3] ( ~ 50 MB ) Apache/2.4.23 Php/5.6.24
|
||||||
- [pluie/alpine-apache-fpm][7] ( ~ 50 MB ) Apache/2.4.23 Php/5.6.24 Fpm
|
- [pluie/alpine-apache-fpm][7] ( ~ 50 MB ) Apache/2.4.23 Php/5.6.24 Fpm
|
||||||
- [pluie/alpine-symfony][6] ( ~ 82 MB ) Symfony2.8 or 3.1
|
- [pluie/alpine-symfony][6] ( ~ 82 MB ) Symfony2.8 or 3.1
|
||||||
|
- [pluie/alpine-apache-php7][8] ( ~ 50 MB ) Apache/2.4.25 Php/7.0.15
|
||||||
- [pluie/alpine-mysql][4] ( ~172 MB ) MariaDb/10.1.14
|
- [pluie/alpine-mysql][4] ( ~172 MB ) MariaDb/10.1.14
|
||||||
- [docker tips][5]
|
- [docker tips][5]
|
||||||
|
|
||||||
|
@ -79,3 +80,4 @@ you can keep same __build__ script in any project
|
||||||
[7]: https://github.com/pluie-org/docker-images/tree/master/pluie/alpine-apache-fpm
|
[7]: https://github.com/pluie-org/docker-images/tree/master/pluie/alpine-apache-fpm
|
||||||
[5]: https://github.com/pluie-org/docker-images/blob/master/DOCKER.md
|
[5]: https://github.com/pluie-org/docker-images/blob/master/DOCKER.md
|
||||||
[6]: https://github.com/pluie-org/docker-images/tree/master/pluie/alpine-symfony
|
[6]: https://github.com/pluie-org/docker-images/tree/master/pluie/alpine-symfony
|
||||||
|
[8]: https://github.com/pluie-org/docker-images/tree/master/pluie/7alpine-php
|
||||||
|
|
|
@ -13,7 +13,7 @@ ENV SHENV_NAME=ApacheFpm \
|
||||||
WWW_DIR=www \
|
WWW_DIR=www \
|
||||||
WWW_INDEX=index.php \
|
WWW_INDEX=index.php \
|
||||||
FIX_OWNERSHIP=1 \
|
FIX_OWNERSHIP=1 \
|
||||||
TZ=Europe/Paris
|
TZ=Europe/Paris
|
||||||
|
|
||||||
EXPOSE 80
|
EXPOSE 80
|
||||||
|
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
- [pluie/alpine-apache][3] ( ~ 50 MB ) Apache/2.4.23 Php/5.6.24
|
- [pluie/alpine-apache][3] ( ~ 50 MB ) Apache/2.4.23 Php/5.6.24
|
||||||
- [pluie/alpine-apache-fpm][7] ( ~ 50 MB ) Apache/2.4.23 Php/5.6.24 Fpm
|
- [pluie/alpine-apache-fpm][7] ( ~ 50 MB ) Apache/2.4.23 Php/5.6.24 Fpm
|
||||||
- [pluie/alpine-symfony][6] ( ~ 82 MB ) Symfony2.8 or 3.1
|
- [pluie/alpine-symfony][6] ( ~ 82 MB ) Symfony2.8 or 3.1
|
||||||
|
- [pluie/alpine-apache-php7][8] ( ~ 50 MB ) Apache/2.4.25 Php/7.0.15
|
||||||
- [pluie/alpine-mysql][4] ( ~172 MB ) MariaDb/10.1.14
|
- [pluie/alpine-mysql][4] ( ~172 MB ) MariaDb/10.1.14
|
||||||
- [docker tips][5]
|
- [docker tips][5]
|
||||||
|
|
||||||
|
@ -20,7 +21,7 @@ Extend pluie/alpine with __apache 2.4.23__ and __php 5.6.24__ with FPM
|
||||||
## ENV variables
|
## ENV variables
|
||||||
|
|
||||||
```
|
```
|
||||||
HTTP_SERVER_NAME=apache.docker # apache ServerName
|
HTTP_SERVER_NAME=fpm.docker # apache ServerName
|
||||||
WWW_DIR=www # DocumentRoot relative to volume
|
WWW_DIR=www # DocumentRoot relative to volume
|
||||||
WWW_INDEX=index.php # DirectoryIndex
|
WWW_INDEX=index.php # DirectoryIndex
|
||||||
FIX_OWNERSHIP=1 #
|
FIX_OWNERSHIP=1 #
|
||||||
|
@ -30,7 +31,7 @@ Extend pluie/alpine with __apache 2.4.23__ and __php 5.6.24__ with FPM
|
||||||
|
|
||||||
```
|
```
|
||||||
SHENV_CTX=LOCAL # LOCAL|INT|PROD change context bg color
|
SHENV_CTX=LOCAL # LOCAL|INT|PROD change context bg color
|
||||||
SHENV_NAME=Apache # container name
|
SHENV_NAME=ApacheFpm # container name
|
||||||
SHENV_COLOR=67 # ANSI EXTENDED COLOR CODE
|
SHENV_COLOR=67 # ANSI EXTENDED COLOR CODE
|
||||||
TZ=Europe/Paris # TIMEZONE
|
TZ=Europe/Paris # TIMEZONE
|
||||||
```
|
```
|
||||||
|
@ -66,17 +67,20 @@ by default it use the apache rewrite module to redirect all uri to entry point $
|
||||||
|
|
||||||
chdir to your project directory
|
chdir to your project directory
|
||||||
```
|
```
|
||||||
$ docker run --name afpm -it --link=mysql:db1 -v $(pwd):/app pluie/alpine-apache-fpm
|
$ docker run --name afpm -it --link=mysql:db -v $(pwd):/app pluie/alpine-apache-fpm
|
||||||
```
|
```
|
||||||
or
|
or
|
||||||
```
|
```
|
||||||
$ docker run --name afpm -d --link=mysql:db1 -e HTTP_SERVER_NAME=yourServerName -v $(pwd):/app pluie/alpine-apache-fpm
|
$ docker run --name afpm -d --link=mysql:db -e HTTP_SERVER_NAME=yourServerName -v $(pwd):/app pluie/alpine-apache-fpm
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
## Controling http server
|
## Controling http server
|
||||||
|
|
||||||
```
|
```
|
||||||
|
# reload
|
||||||
|
$ docker exec -it afpm "httpd -k graceful"
|
||||||
|
# restart
|
||||||
$ docker exec -it afpm "httpd -k restart"
|
$ docker exec -it afpm "httpd -k restart"
|
||||||
```
|
```
|
||||||
for more commands :
|
for more commands :
|
||||||
|
@ -91,3 +95,4 @@ $ docker exec -it afpm "httpd -h"
|
||||||
[7]: https://github.com/pluie-org/docker-images/tree/master/pluie/alpine-apache-fpm
|
[7]: https://github.com/pluie-org/docker-images/tree/master/pluie/alpine-apache-fpm
|
||||||
[5]: https://github.com/pluie-org/docker-images/blob/master/DOCKER.md
|
[5]: https://github.com/pluie-org/docker-images/blob/master/DOCKER.md
|
||||||
[6]: https://github.com/pluie-org/docker-images/tree/master/pluie/alpine-symfony
|
[6]: https://github.com/pluie-org/docker-images/tree/master/pluie/alpine-symfony
|
||||||
|
[8]: https://github.com/pluie-org/docker-images/tree/master/pluie/7alpine-php
|
||||||
|
|
Binary file not shown.
1
pluie/alpine-apache-php7/.gitignore
vendored
Normal file
1
pluie/alpine-apache-php7/.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
||||||
|
files.tar
|
20
pluie/alpine-apache-php7/Dockerfile
Normal file
20
pluie/alpine-apache-php7/Dockerfile
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
# @app pluie/alpine-apache
|
||||||
|
# @author a-Sansara https://git.pluie.org/pluie/docker-images
|
||||||
|
|
||||||
|
FROM pluie/alpine
|
||||||
|
|
||||||
|
MAINTAINER a-Sansara https://github.com/a-sansara
|
||||||
|
|
||||||
|
ADD files.tar /scripts
|
||||||
|
|
||||||
|
ENV SHENV_NAME=Php7 \
|
||||||
|
SHENV_COLOR=67 \
|
||||||
|
HTTP_SERVER_NAME=test.docker \
|
||||||
|
WWW_DIR=www \
|
||||||
|
WWW_INDEX=index.php \
|
||||||
|
FIX_OWNERSHIP=1 \
|
||||||
|
TZ=Europe/Paris
|
||||||
|
|
||||||
|
EXPOSE 80
|
||||||
|
|
||||||
|
RUN bash /scripts/install.sh
|
94
pluie/alpine-apache-php7/README.md
Normal file
94
pluie/alpine-apache-php7/README.md
Normal file
|
@ -0,0 +1,94 @@
|
||||||
|
# pluie/alpine-apache
|
||||||
|
|
||||||
|
- [index][1]
|
||||||
|
- [pluie/alpine][2] ( < 10 MB ) Alpine/3.4
|
||||||
|
- [pluie/alpine-apache][3] ( ~ 50 MB ) Apache/2.4.23 Php/5.6.24
|
||||||
|
- [pluie/alpine-apache-fpm][7] ( ~ 50 MB ) Apache/2.4.23 Php/5.6.24 Fpm
|
||||||
|
- [pluie/alpine-symfony][6] ( ~ 82 MB ) Symfony2.8 or 3.0
|
||||||
|
- [pluie/alpine-apache-php7][8] ( ~ 50 MB ) Apache/2.4.25 Php/7.0.15
|
||||||
|
- [pluie/alpine-mysql][4] ( ~172 MB ) Mysql/5.5.47 ( MariaDB )
|
||||||
|
- [docker tips][5]
|
||||||
|
|
||||||
|
Extend pluie/alpine with __apache 2.4.25__ and __php 7.0.15__
|
||||||
|
|
||||||
|
- error log are attached to stdout
|
||||||
|
- no need port redirection
|
||||||
|
- you can use env var at container creation : __HTTP_SERVER_NAME__ (default : site.docker ortherwise edit /app/vhost later)
|
||||||
|
- you can still use ever your local http & sql server while your container(s) are running
|
||||||
|
|
||||||
|
|
||||||
|
## Image Size
|
||||||
|
|
||||||
|
- image ~ 82 MB
|
||||||
|
|
||||||
|
## ENV variables
|
||||||
|
|
||||||
|
```
|
||||||
|
HTTP_SERVER_NAME=site.docker # apache ServerName
|
||||||
|
WWW_DIR=www # DocumentRoot relative to volume
|
||||||
|
WWW_INDEX=index.php # DirectoryIndex
|
||||||
|
FIX_OWNERSHIP=1 #
|
||||||
|
```
|
||||||
|
|
||||||
|
### Inherit ENV variables
|
||||||
|
|
||||||
|
```
|
||||||
|
SHENV_CTX=LOCAL # LOCAL|INT|PROD change context bg color
|
||||||
|
SHENV_NAME=Php7 # container name
|
||||||
|
SHENV_COLOR=67 # ANSI EXTENDED COLOR CODE
|
||||||
|
TZ=Europe/Paris # TIMEZONE
|
||||||
|
```
|
||||||
|
|
||||||
|
## Image Volumes
|
||||||
|
|
||||||
|
__/app__ directory is a docker volume bind to your app project (silex/symfony etc)
|
||||||
|
|
||||||
|
__/app/$WWW_DIR__ is the documentRoot.
|
||||||
|
put only your entry point and static files to the documentRoot directory, no your app sources
|
||||||
|
(__/app__ directory is design for this).
|
||||||
|
|
||||||
|
__/app/vhost__ is your app vhost configuration file (with a serverName directive).
|
||||||
|
by default it use the apache rewrite module to redirect all uri to entry point $WWW_INDEX
|
||||||
|
|
||||||
|
```
|
||||||
|
/app/ # your application directory
|
||||||
|
|
|
||||||
|
|---- $WWW_DIR/ # documentRoot
|
||||||
|
|
|
||||||
|
|---- vhost # apache app vhost
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
## Image Usage
|
||||||
|
|
||||||
|
chdir to your project directory
|
||||||
|
```
|
||||||
|
$ docker run --name php7 -it --link=mysql:db -v $(pwd):/app pluie/alpine-apache
|
||||||
|
```
|
||||||
|
or
|
||||||
|
```
|
||||||
|
$ docker run --name php7 -it --link=mysql:db -e HTTP_SERVER_NAME=yourServerName -v $(pwd):/app pluie/alpine-apache-php7
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
## Controling http server
|
||||||
|
|
||||||
|
```
|
||||||
|
# reload
|
||||||
|
$ docker exec -it php7 "httpd -k graceful"
|
||||||
|
# restart
|
||||||
|
$ docker exec -it php7 "httpd -k restart"
|
||||||
|
```
|
||||||
|
for more commands :
|
||||||
|
```
|
||||||
|
$ docker exec -it php7 "httpd -h"
|
||||||
|
```
|
||||||
|
|
||||||
|
[1]: https://github.com/pluie-org/docker-images
|
||||||
|
[2]: https://github.com/pluie-org/docker-images/tree/master/pluie/alpine
|
||||||
|
[3]: https://github.com/pluie-org/docker-images/tree/master/pluie/alpine-apache
|
||||||
|
[4]: https://github.com/pluie-org/docker-images/tree/master/pluie/alpine-mysql
|
||||||
|
[7]: https://github.com/pluie-org/docker-images/tree/master/pluie/alpine-apache-fpm
|
||||||
|
[5]: https://github.com/pluie-org/docker-images/blob/master/DOCKER.md
|
||||||
|
[6]: https://github.com/pluie-org/docker-images/tree/master/pluie/alpine-symfony
|
||||||
|
[8]: https://github.com/pluie-org/docker-images/tree/master/pluie/alpine-apache-php7
|
22
pluie/alpine-apache-php7/build
Executable file
22
pluie/alpine-apache-php7/build
Executable file
|
@ -0,0 +1,22 @@
|
||||||
|
#!/bin/bash
|
||||||
|
# @app pluie/alpine-apache
|
||||||
|
# @author a-Sansara https://git.pluie.org/pluie/docker-images
|
||||||
|
|
||||||
|
Ctitle="\033[1;38;5;15;1;48;5;30m"
|
||||||
|
Citem="\033[1;38;5;36m"
|
||||||
|
Coff="\033[m"
|
||||||
|
DOCKDIR=$(dirname "$(readlink -f ${BASH_SOURCE[0]})")
|
||||||
|
DOCKBUILD=$(basename $DOCKDIR)
|
||||||
|
DOCKREPO=$(basename $(dirname $DOCKDIR))
|
||||||
|
DOCKTAG=${1:-"latest"}
|
||||||
|
TMPPWD=$(pwd)
|
||||||
|
indent=" "
|
||||||
|
cd $DOCKDIR
|
||||||
|
echo -e "\n ${Ctitle} Preparing files : ${Coff}${Citem}\n"
|
||||||
|
|
||||||
|
tar -cvf files.tar *.sh pre-init.d/ install.d/ | sed "s/^/${indent}↠ /"
|
||||||
|
|
||||||
|
echo -e "\n ${Ctitle} Proceed Dockerfile build : ${Coff}\n
|
||||||
|
"
|
||||||
|
docker build --force-rm -t ${DOCKREPO}/${DOCKBUILD}:${DOCKTAG} . | sed "s/^/${indent}/"
|
||||||
|
cd $TMPPWD
|
8
pluie/alpine-apache-php7/install.d/00-repo.sh
Normal file
8
pluie/alpine-apache-php7/install.d/00-repo.sh
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
#!/bin/bash
|
||||||
|
# @app pluie/alpine-apache-php7
|
||||||
|
# @author a-Sansara https://git.pluie.org/pluie/docker-images
|
||||||
|
|
||||||
|
echo "http://dl-cdn.alpinelinux.org/alpine/edge/community
|
||||||
|
http://dl-cdn.alpinelinux.org/alpine/edge/main
|
||||||
|
http://dl-cdn.alpinelinux.org/alpine/edge/testing
|
||||||
|
" > /etc/apk/repositories
|
9
pluie/alpine-apache-php7/install.d/10-apache.sh
Executable file
9
pluie/alpine-apache-php7/install.d/10-apache.sh
Executable file
|
@ -0,0 +1,9 @@
|
||||||
|
#!/bin/bash
|
||||||
|
# @app pluie/alpine-apache
|
||||||
|
# @author a-Sansara https://git.pluie.org/pluie/docker-images
|
||||||
|
|
||||||
|
apk --update add apache2 apache2-proxy \
|
||||||
|
php7-apache2 php7-mbstring php7-session php7-phar php7-zlib php7-zip php7-ctype \
|
||||||
|
php7-mysqli php7-xml php7-pdo_mysql php7-opcache php7-pdo php7-json php7-curl \
|
||||||
|
php7-gd php7-mcrypt php7-openssl php7-\dom \
|
||||||
|
# php-pdo_odbc php-soap php-pgsql
|
53
pluie/alpine-apache-php7/install.d/50-fix-apache.sh
Executable file
53
pluie/alpine-apache-php7/install.d/50-fix-apache.sh
Executable file
|
@ -0,0 +1,53 @@
|
||||||
|
#!/bin/bash
|
||||||
|
# @app pluie/alpine-apache
|
||||||
|
# @author a-Sansara https://git.pluie.org/pluie/docker-images
|
||||||
|
|
||||||
|
function a2setModule(){
|
||||||
|
local enable=${1:-''}
|
||||||
|
local path=${3:-'/etc/apache2/httpd.conf'}
|
||||||
|
local scom=''
|
||||||
|
local rcom='\#'
|
||||||
|
if [ ! -z $1 ] && [ ! -z "$2" ]; then
|
||||||
|
if [ "$enable" = 1 ]; then
|
||||||
|
scom='\#'
|
||||||
|
rcom=''
|
||||||
|
fi
|
||||||
|
echo "$2"
|
||||||
|
sed -i "s#${scom}LoadModule $2_module modules/mod_$2.so#${rcom}LoadModule $2_module modules/mod_$2.so#" "$path"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
if [ ! -f /usr/lib/php ]; then
|
||||||
|
ln -s /usr/lib/php7 /usr/lib/php
|
||||||
|
fi
|
||||||
|
if [ ! -f /usr/lib/libxml2.so ]; then
|
||||||
|
ln -s /usr/lib/libxml2.so.2 /usr/lib/libxml2.so
|
||||||
|
fi
|
||||||
|
if [ ! -d /app/$WWW_DIR ]; then
|
||||||
|
mkdir -p /app/$WWW_DIR
|
||||||
|
fi
|
||||||
|
if [ ! -d /run/apache2 ]; then
|
||||||
|
mkdir /run/apache2
|
||||||
|
fi
|
||||||
|
chown -R 1000:apache /app/$WWW_DIR
|
||||||
|
chmod -R 755 /scripts/pre-init.d
|
||||||
|
mkdir -p /run/apache2
|
||||||
|
chown apache:apache /run/apache2
|
||||||
|
|
||||||
|
tmpsed='s#^DocumentRoot ".*#DocumentRoot "/app/'$WWW_DIR'"#g'
|
||||||
|
sed -i "$tmpsed" /etc/apache2/httpd.conf
|
||||||
|
sed -i 's#AllowOverride none#AllowOverride All#' /etc/apache2/httpd.conf
|
||||||
|
|
||||||
|
initTitle "Apache" "Loading Modules"
|
||||||
|
a2setModule 1 "rewrite"
|
||||||
|
a2setModule 1 "mpm_prefork"
|
||||||
|
a2setModule 1 "slotmem_shm"
|
||||||
|
a2setModule 1 "heartmonitor"
|
||||||
|
#~ a2setModule 1 "watchdog"
|
||||||
|
initTitle "Apache" "Removing Modules"
|
||||||
|
a2setModule 0 "mpm_event"
|
||||||
|
a2setModule 0 "proxy_fdpass" /etc/apache2/conf.d/proxy.conf
|
||||||
|
|
||||||
|
sed -i "s|;*date.timezone =.*|date.timezone = ${TZ}|i" /etc/php7/php.ini
|
||||||
|
sed -ir 's/expose_php = On/expose_php = Off/' /etc/php7/php.ini
|
||||||
|
echo -e "\nIncludeOptional /app/vhost" >> /etc/apache2/httpd.conf
|
||||||
|
unset tmpsed
|
8
pluie/alpine-apache-php7/main.sh
Executable file
8
pluie/alpine-apache-php7/main.sh
Executable file
|
@ -0,0 +1,8 @@
|
||||||
|
#!/bin/bash
|
||||||
|
# @app pluie/alpine-apache
|
||||||
|
# @author a-Sansara https://git.pluie.org/pluie/docker-images
|
||||||
|
|
||||||
|
. /scripts/common.sh
|
||||||
|
|
||||||
|
initTitle "Starting" "Apache Daemon"
|
||||||
|
httpd -D FOREGROUND
|
11
pluie/alpine-apache-php7/pre-init.d/10-apache.sh
Executable file
11
pluie/alpine-apache-php7/pre-init.d/10-apache.sh
Executable file
|
@ -0,0 +1,11 @@
|
||||||
|
#!/usr/bin/bash
|
||||||
|
# @app pluie/alpine-apache
|
||||||
|
# @author a-Sansara https://git.pluie.org/pluie/docker-images
|
||||||
|
|
||||||
|
if [ ! -z "$FIX_OWNERSHIP" ] && [ "$FIX_OWNERSHIP" -eq 1 ] && [ -d /app/$WWW_DIR ]; then
|
||||||
|
chown -R 1000:apache /app/$WWW_DIR
|
||||||
|
fi
|
||||||
|
|
||||||
|
touch /var/log/apache2/error.log
|
||||||
|
|
||||||
|
tail -F /var/log/apache2/error.log &
|
24
pluie/alpine-apache-php7/pre-init.d/10-vhost.sh
Executable file
24
pluie/alpine-apache-php7/pre-init.d/10-vhost.sh
Executable file
|
@ -0,0 +1,24 @@
|
||||||
|
#!/usr/bin/bash
|
||||||
|
# @app pluie/alpine-apache
|
||||||
|
# @author a-Sansara https://git.pluie.org/pluie/docker-images
|
||||||
|
|
||||||
|
if [ ! -z "/app/vhost" ]; then
|
||||||
|
cat <<EOF > "/app/vhost"
|
||||||
|
<VirtualHost *:80>
|
||||||
|
ServerName $HTTP_SERVER_NAME
|
||||||
|
SetEnvIfNoCase ^Authorization$ "(.+)" HTTP_AUTHORIZATION=$1
|
||||||
|
<Directory /app/$WWW_DIR>
|
||||||
|
AllowOverride None
|
||||||
|
Require all granted
|
||||||
|
DirectoryIndex $WWW_INDEX
|
||||||
|
<IfModule mod_rewrite.c>
|
||||||
|
Options -MultiViews +FollowSymlinks
|
||||||
|
RewriteEngine On
|
||||||
|
RewriteCond %{REQUEST_FILENAME} !-f
|
||||||
|
RewriteRule ^ $WWW_INDEX [QSA,L]
|
||||||
|
</IfModule>
|
||||||
|
</Directory>
|
||||||
|
</VirtualHost>
|
||||||
|
# IncludeOptional /app/vhost2
|
||||||
|
EOF
|
||||||
|
fi
|
|
@ -13,7 +13,7 @@ ENV SHENV_NAME=Apache \
|
||||||
WWW_DIR=www \
|
WWW_DIR=www \
|
||||||
WWW_INDEX=index.php \
|
WWW_INDEX=index.php \
|
||||||
FIX_OWNERSHIP=1 \
|
FIX_OWNERSHIP=1 \
|
||||||
TZ=Europe/Paris
|
TZ=Europe/Paris
|
||||||
|
|
||||||
EXPOSE 80
|
EXPOSE 80
|
||||||
|
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
- [pluie/alpine-apache][3] ( ~ 50 MB ) Apache/2.4.23 Php/5.6.24
|
- [pluie/alpine-apache][3] ( ~ 50 MB ) Apache/2.4.23 Php/5.6.24
|
||||||
- [pluie/alpine-apache-fpm][7] ( ~ 50 MB ) Apache/2.4.23 Php/5.6.24 Fpm
|
- [pluie/alpine-apache-fpm][7] ( ~ 50 MB ) Apache/2.4.23 Php/5.6.24 Fpm
|
||||||
- [pluie/alpine-symfony][6] ( ~ 82 MB ) Symfony2.8 or 3.0
|
- [pluie/alpine-symfony][6] ( ~ 82 MB ) Symfony2.8 or 3.0
|
||||||
|
- [pluie/alpine-apache-php7][8] ( ~ 50 MB ) Apache/2.4.25 Php/7.0.15
|
||||||
- [pluie/alpine-mysql][4] ( ~172 MB ) Mysql/5.5.47 ( MariaDB )
|
- [pluie/alpine-mysql][4] ( ~172 MB ) Mysql/5.5.47 ( MariaDB )
|
||||||
- [docker tips][5]
|
- [docker tips][5]
|
||||||
|
|
||||||
|
@ -12,7 +13,7 @@ Extend pluie/alpine with __apache 2.4.23__ and __php 5.6.24__
|
||||||
|
|
||||||
- error log are attached to stdout
|
- error log are attached to stdout
|
||||||
- no need port redirection
|
- no need port redirection
|
||||||
- you can use env var at container creation : __HTTP_SERVER_NAME__ (default : docker-site.dev ortherwise edit app/vhost later)
|
- you can use env var at container creation : __HTTP_SERVER_NAME__ (default : apache.docker ortherwise edit app/vhost later)
|
||||||
- you can still use ever your local http & sql server while your container(s) are running
|
- you can still use ever your local http & sql server while your container(s) are running
|
||||||
|
|
||||||
|
|
||||||
|
@ -62,23 +63,27 @@ by default it use the apache rewrite module to redirect all uri to entry point $
|
||||||
|
|
||||||
chdir to your project directory
|
chdir to your project directory
|
||||||
```
|
```
|
||||||
$ docker run --name apache -it --link=mysql:db1 -v $(pwd):/app pluie/alpine-apache
|
$ docker run --name apache -it --link=mysql:db -v $(pwd):/app pluie/alpine-apache
|
||||||
```
|
```
|
||||||
or
|
or
|
||||||
```
|
```
|
||||||
$ docker run --name apache -it --link=mysql:db1 -e HTTP_SERVER_NAME=yourServerName -v $(pwd):/app pluie/alpine-apache
|
$ docker run --name apache -it --link=mysql:db -e HTTP_SERVER_NAME=yourServerName -v $(pwd):/app pluie/alpine-apache
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
## Controling http server
|
## Controling http server
|
||||||
|
|
||||||
```
|
```
|
||||||
|
# reload
|
||||||
|
$ docker exec -it apache "httpd -k graceful"
|
||||||
|
# restart
|
||||||
$ docker exec -it apache "httpd -k restart"
|
$ docker exec -it apache "httpd -k restart"
|
||||||
```
|
```
|
||||||
for more commands :
|
for more commands :
|
||||||
```
|
```
|
||||||
$ docker exec -it apache "httpd -h"
|
$ docker exec -it apache "httpd -h"
|
||||||
```
|
```
|
||||||
|
|
||||||
[1]: https://github.com/pluie-org/docker-images
|
[1]: https://github.com/pluie-org/docker-images
|
||||||
[2]: https://github.com/pluie-org/docker-images/tree/master/pluie/alpine
|
[2]: https://github.com/pluie-org/docker-images/tree/master/pluie/alpine
|
||||||
[3]: https://github.com/pluie-org/docker-images/tree/master/pluie/alpine-apache
|
[3]: https://github.com/pluie-org/docker-images/tree/master/pluie/alpine-apache
|
||||||
|
@ -86,3 +91,4 @@ $ docker exec -it apache "httpd -h"
|
||||||
[7]: https://github.com/pluie-org/docker-images/tree/master/pluie/alpine-apache-fpm
|
[7]: https://github.com/pluie-org/docker-images/tree/master/pluie/alpine-apache-fpm
|
||||||
[5]: https://github.com/pluie-org/docker-images/blob/master/DOCKER.md
|
[5]: https://github.com/pluie-org/docker-images/blob/master/DOCKER.md
|
||||||
[6]: https://github.com/pluie-org/docker-images/tree/master/pluie/alpine-symfony
|
[6]: https://github.com/pluie-org/docker-images/tree/master/pluie/alpine-symfony
|
||||||
|
[8]: https://github.com/pluie-org/docker-images/tree/master/pluie/7alpine-php
|
||||||
|
|
Binary file not shown.
|
@ -5,6 +5,7 @@
|
||||||
- [pluie/alpine-apache][3] ( ~ 50 MB ) Apache/2.4.23 Php/5.6.24
|
- [pluie/alpine-apache][3] ( ~ 50 MB ) Apache/2.4.23 Php/5.6.24
|
||||||
- [pluie/alpine-apache-fpm][7] ( ~ 50 MB ) Apache/2.4.23 Php/5.6.24 Fpm
|
- [pluie/alpine-apache-fpm][7] ( ~ 50 MB ) Apache/2.4.23 Php/5.6.24 Fpm
|
||||||
- [pluie/alpine-symfony][6] ( ~ 82 MB ) Symfony2.8 or 3.1
|
- [pluie/alpine-symfony][6] ( ~ 82 MB ) Symfony2.8 or 3.1
|
||||||
|
- [pluie/alpine-apache-php7][8] ( ~ 50 MB ) Apache/2.4.25 Php/7.0.15
|
||||||
- [pluie/alpine-mysql][4] ( ~172 MB ) MariaDb/10.1.14
|
- [pluie/alpine-mysql][4] ( ~172 MB ) MariaDb/10.1.14
|
||||||
- [docker tips][5]
|
- [docker tips][5]
|
||||||
|
|
||||||
|
@ -126,7 +127,6 @@ to link this container to another, use the default docker behavior
|
||||||
docker run --name mycontainer --link mysql:db ...
|
docker run --name mycontainer --link mysql:db ...
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
[1]: https://github.com/pluie-org/docker-images
|
[1]: https://github.com/pluie-org/docker-images
|
||||||
[2]: https://github.com/pluie-org/docker-images/tree/master/pluie/alpine
|
[2]: https://github.com/pluie-org/docker-images/tree/master/pluie/alpine
|
||||||
[3]: https://github.com/pluie-org/docker-images/tree/master/pluie/alpine-apache
|
[3]: https://github.com/pluie-org/docker-images/tree/master/pluie/alpine-apache
|
||||||
|
@ -134,3 +134,4 @@ docker run --name mycontainer --link mysql:db ...
|
||||||
[7]: https://github.com/pluie-org/docker-images/tree/master/pluie/alpine-apache-fpm
|
[7]: https://github.com/pluie-org/docker-images/tree/master/pluie/alpine-apache-fpm
|
||||||
[5]: https://github.com/pluie-org/docker-images/blob/master/DOCKER.md
|
[5]: https://github.com/pluie-org/docker-images/blob/master/DOCKER.md
|
||||||
[6]: https://github.com/pluie-org/docker-images/tree/master/pluie/alpine-symfony
|
[6]: https://github.com/pluie-org/docker-images/tree/master/pluie/alpine-symfony
|
||||||
|
[8]: https://github.com/pluie-org/docker-images/tree/master/pluie/7alpine-php
|
||||||
|
|
Binary file not shown.
|
@ -5,6 +5,7 @@
|
||||||
- [pluie/alpine-apache][3] ( ~ 50 MB ) Apache/2.4.23 Php/5.6.24
|
- [pluie/alpine-apache][3] ( ~ 50 MB ) Apache/2.4.23 Php/5.6.24
|
||||||
- [pluie/alpine-apache-fpm][7] ( ~ 50 MB ) Apache/2.4.23 Php/5.6.24 Fpm
|
- [pluie/alpine-apache-fpm][7] ( ~ 50 MB ) Apache/2.4.23 Php/5.6.24 Fpm
|
||||||
- [pluie/alpine-symfony][6] ( ~ 82 MB ) Symfony2.8 or 3.1
|
- [pluie/alpine-symfony][6] ( ~ 82 MB ) Symfony2.8 or 3.1
|
||||||
|
- [pluie/alpine-apache-php7][8] ( ~ 50 MB ) Apache/2.4.25 Php/7.0.15
|
||||||
- [pluie/alpine-mysql][4] ( ~172 MB ) MariaDb/10.1.14
|
- [pluie/alpine-mysql][4] ( ~172 MB ) MariaDb/10.1.14
|
||||||
- [docker tips][5]
|
- [docker tips][5]
|
||||||
|
|
||||||
|
@ -20,7 +21,7 @@ the symfony framework with $SYMFONY_VERSION version on the /app directory
|
||||||
## ENV variables
|
## ENV variables
|
||||||
|
|
||||||
```
|
```
|
||||||
SYMFONY_VERSION=3.1 # symfony version
|
SYMFONY_VERSION=3.1 # symfony version
|
||||||
```
|
```
|
||||||
|
|
||||||
### Inherit ENV variables
|
### Inherit ENV variables
|
||||||
|
@ -46,11 +47,11 @@ the symfony framework with $SYMFONY_VERSION version on the /app directory
|
||||||
|
|
||||||
chdir to your project directory
|
chdir to your project directory
|
||||||
```
|
```
|
||||||
$ docker run --name symfony -it --link=mysql:db1 -v $(pwd):/app pluie/alpine-symfony
|
$ docker run --name symfony -it --link=mysql:db -v $(pwd):/app pluie/alpine-symfony
|
||||||
```
|
```
|
||||||
or
|
or
|
||||||
```
|
```
|
||||||
$ docker run --name symfony -d --link=mysql:db1 -e HTTP_SERVER_NAME=yourServerName -v $(pwd):/app pluie/alpine-symfony
|
$ docker run --name symfony -d --link=mysql:db -e HTTP_SERVER_NAME=yourServerName -v $(pwd):/app pluie/alpine-symfony
|
||||||
```
|
```
|
||||||
|
|
||||||
## Connect to container
|
## Connect to container
|
||||||
|
@ -66,3 +67,4 @@ $ docker exec -it symfony bash
|
||||||
[7]: https://github.com/pluie-org/docker-images/tree/master/pluie/alpine-apache-fpm
|
[7]: https://github.com/pluie-org/docker-images/tree/master/pluie/alpine-apache-fpm
|
||||||
[5]: https://github.com/pluie-org/docker-images/blob/master/DOCKER.md
|
[5]: https://github.com/pluie-org/docker-images/blob/master/DOCKER.md
|
||||||
[6]: https://github.com/pluie-org/docker-images/tree/master/pluie/alpine-symfony
|
[6]: https://github.com/pluie-org/docker-images/tree/master/pluie/alpine-symfony
|
||||||
|
[8]: https://github.com/pluie-org/docker-images/tree/master/pluie/7alpine-php
|
||||||
|
|
Binary file not shown.
|
@ -2,7 +2,7 @@
|
||||||
# @app pluie/alpine-symfony
|
# @app pluie/alpine-symfony
|
||||||
# @author a-Sansara https://git.pluie.org/pluie/docker-images
|
# @author a-Sansara https://git.pluie.org/pluie/docker-images
|
||||||
|
|
||||||
|
ln -s /usr/bin/php7 /usr/bin/php
|
||||||
if [ ! -d /app/$WWW_DIR ]; then
|
if [ ! -d /app/$WWW_DIR ]; then
|
||||||
cd /tmp
|
cd /tmp
|
||||||
mkdir $WWW_DIR
|
mkdir $WWW_DIR
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
- [pluie/alpine-apache][3] ( ~ 50 MB ) Apache/2.4.23 Php/5.6.24
|
- [pluie/alpine-apache][3] ( ~ 50 MB ) Apache/2.4.23 Php/5.6.24
|
||||||
- [pluie/alpine-apache-fpm][7] ( ~ 50 MB ) Apache/2.4.23 Php/5.6.24 Fpm
|
- [pluie/alpine-apache-fpm][7] ( ~ 50 MB ) Apache/2.4.23 Php/5.6.24 Fpm
|
||||||
- [pluie/alpine-symfony][6] ( ~ 82 MB ) Symfony2.8 or 3.1
|
- [pluie/alpine-symfony][6] ( ~ 82 MB ) Symfony2.8 or 3.1
|
||||||
|
- [pluie/alpine-apache-php7][8] ( ~ 50 MB ) Apache/2.4.25 Php/7.0.15
|
||||||
- [pluie/alpine-mysql][4] ( ~172 MB ) MariaDb/10.1.14
|
- [pluie/alpine-mysql][4] ( ~172 MB ) MariaDb/10.1.14
|
||||||
- [docker tips][5]
|
- [docker tips][5]
|
||||||
|
|
||||||
|
@ -105,3 +106,4 @@ RUN bash /scripts/install.sh
|
||||||
[7]: https://github.com/pluie-org/docker-images/tree/master/pluie/alpine-apache-fpm
|
[7]: https://github.com/pluie-org/docker-images/tree/master/pluie/alpine-apache-fpm
|
||||||
[5]: https://github.com/pluie-org/docker-images/blob/master/DOCKER.md
|
[5]: https://github.com/pluie-org/docker-images/blob/master/DOCKER.md
|
||||||
[6]: https://github.com/pluie-org/docker-images/tree/master/pluie/alpine-symfony
|
[6]: https://github.com/pluie-org/docker-images/tree/master/pluie/alpine-symfony
|
||||||
|
[8]: https://github.com/pluie-org/docker-images/tree/master/pluie/7alpine-php
|
||||||
|
|
Binary file not shown.
Loading…
Reference in New Issue
Block a user