adding image pluie/alpine-apache
This commit is contained in:
parent
6dfc4e3a66
commit
471927be29
1
pluie/alpine-apache/.gitignore
vendored
Normal file
1
pluie/alpine-apache/.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
||||||
|
files.tar
|
13
pluie/alpine-apache/Dockerfile
Normal file
13
pluie/alpine-apache/Dockerfile
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
FROM pluie/alpine
|
||||||
|
|
||||||
|
MAINTAINER a-Sansara https://github.com/a-sansara
|
||||||
|
|
||||||
|
ADD files.tar /scripts
|
||||||
|
|
||||||
|
RUN bash /scripts/install.sh
|
||||||
|
|
||||||
|
ENV SHENV_NAME=Apache SHENV_COLOR=67 HTTP_SERVER_NAME=docker-site.dev FIX_OWNERSHIP=1
|
||||||
|
|
||||||
|
EXPOSE 80
|
||||||
|
|
||||||
|
VOLUME /app
|
21
pluie/alpine-apache/build
Executable file
21
pluie/alpine-apache/build
Executable file
|
@ -0,0 +1,21 @@
|
||||||
|
#!/bin/bash
|
||||||
|
# pluie/docker-images - a-Sansara (https://github.com/a-sansara)
|
||||||
|
|
||||||
|
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
|
7
pluie/alpine-apache/install.d/10-apache.sh
Executable file
7
pluie/alpine-apache/install.d/10-apache.sh
Executable file
|
@ -0,0 +1,7 @@
|
||||||
|
#!/bin/bash
|
||||||
|
# pluie/docker-images - a-Sansara (https://github.com/a-sansara)
|
||||||
|
|
||||||
|
apk --update add apache2 \
|
||||||
|
php-apache2 php-cli php-phar php-zlib php-zip php-ctype php-mysqli php-pdo_mysql php-xml \
|
||||||
|
php-opcache php-pdo php-json php-curl php-gd php-mcrypt php-openssl \
|
||||||
|
# php-pdo_odbc php-soap php-pgsql
|
10
pluie/alpine-apache/install.d/50-fix-apache.sh
Executable file
10
pluie/alpine-apache/install.d/50-fix-apache.sh
Executable file
|
@ -0,0 +1,10 @@
|
||||||
|
#!/bin/bash
|
||||||
|
# pluie/docker-images - a-Sansara (https://github.com/a-sansara)
|
||||||
|
|
||||||
|
mkdir -p /app/www
|
||||||
|
chown -R 1000:apache /app/www
|
||||||
|
chmod -R 755 /scripts/pre-init.d
|
||||||
|
sed -i 's#^DocumentRoot ".*#DocumentRoot "/app/www"#g' /etc/apache2/httpd.conf
|
||||||
|
sed -i 's#AllowOverride none#AllowOverride All#' /etc/apache2/httpd.conf
|
||||||
|
sed -ir 's/expose_php = On/expose_php = Off/' /etc/php/php.ini
|
||||||
|
echo -e "\nIncludeOptional /app/vhost" >> /etc/apache2/httpd.conf
|
7
pluie/alpine-apache/main.sh
Executable file
7
pluie/alpine-apache/main.sh
Executable file
|
@ -0,0 +1,7 @@
|
||||||
|
#!/bin/bash
|
||||||
|
# pluie/docker-images - a-Sansara (https://github.com/a-sansara)
|
||||||
|
|
||||||
|
. /scripts/common.sh
|
||||||
|
|
||||||
|
echo "[[ Starting Apache Daemon ]]"
|
||||||
|
httpd -D FOREGROUND
|
10
pluie/alpine-apache/pre-init.d/10-apache.sh
Executable file
10
pluie/alpine-apache/pre-init.d/10-apache.sh
Executable file
|
@ -0,0 +1,10 @@
|
||||||
|
#!/usr/bin/bash
|
||||||
|
# pluie/docker-images - a-Sansara (https://github.com/a-sansara)
|
||||||
|
|
||||||
|
if [ ! -z "$FIX_OWNERSHIP" ] && [ "$FIX_OWNERSHIP" -eq 1 ]; then
|
||||||
|
chown -R 1000:apache /app/www
|
||||||
|
fi
|
||||||
|
|
||||||
|
touch /var/log/apache2/error.log
|
||||||
|
|
||||||
|
tail -F /var/log/apache2/error.log &
|
22
pluie/alpine-apache/pre-init.d/10-vhost.sh
Executable file
22
pluie/alpine-apache/pre-init.d/10-vhost.sh
Executable file
|
@ -0,0 +1,22 @@
|
||||||
|
#!/usr/bin/bash
|
||||||
|
# pluie/docker-images - a-Sansara (https://github.com/a-sansara)
|
||||||
|
|
||||||
|
if [ ! -z "/app/vhost" ]; then
|
||||||
|
cat <<EOF > "/app/vhost"
|
||||||
|
<VirtualHost *:80>
|
||||||
|
ServerName $HTTP_SERVER_NAME
|
||||||
|
<Directory /app/www>
|
||||||
|
AllowOverride None
|
||||||
|
Allow from all
|
||||||
|
DirectoryIndex index.php
|
||||||
|
<IfModule mod_rewrite.c>
|
||||||
|
Options -MultiViews +FollowSymlinks
|
||||||
|
RewriteEngine On
|
||||||
|
RewriteCond %{REQUEST_FILENAME} !-f
|
||||||
|
RewriteRule ^ index.php [QSA,L]
|
||||||
|
</IfModule>
|
||||||
|
</Directory>
|
||||||
|
</VirtualHost>
|
||||||
|
# IncludeOptional /app/vhost2
|
||||||
|
EOF
|
||||||
|
fi
|
|
@ -1,18 +1,12 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# pluie/docker-images - a-Sansara (https://github.com/a-sansara)
|
# pluie/docker-images - a-Sansara (https://github.com/a-sansara)
|
||||||
echo "ps1"
|
|
||||||
if [ ! -f /root/.bash_ps1 ]; then
|
|
||||||
echo "existe pas"
|
|
||||||
else
|
|
||||||
echo "existe"
|
|
||||||
fi
|
|
||||||
if [ ! -f /root/.bash_ps1 ]; then
|
if [ ! -f /root/.bash_ps1 ]; then
|
||||||
cat <<EOF >> /root/.bashrc
|
cat <<EOF >> /root/.bashrc
|
||||||
if [ -f ~/.bash_ps1 ]; then
|
if [ -f ~/.bash_ps1 ]; then
|
||||||
. ~/.bash_ps1
|
. ~/.bash_ps1
|
||||||
fi
|
fi
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
sed -n '1,22 p' /scripts/util.sh > /root/.bash_ps1
|
sed -n '1,22 p' /scripts/util.sh > /root/.bash_ps1
|
||||||
echo "bash_prompt" >> /root/.bash_ps1
|
echo "bash_prompt" >> /root/.bash_ps1
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in New Issue
Block a user