oddzielny obraz plug/rest

master
Michał 'rysiek' Woźniak 2015-01-06 21:10:04 +01:00
parent c048fa5a38
commit 14879937f4
5 changed files with 25 additions and 16 deletions

17
images/rest/Dockerfile Normal file
View File

@ -0,0 +1,17 @@
FROM plug/php-fpm
MAINTAINER Michał "rysiek" Woźniak <rysiek@hackerspace.pl>
ENV APP_NAME "rest"
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update && apt-get install -y --no-install-recommends git wkhtmltopdf
RUN mkdir /opt/rest \
&& echo "<h1>PHP-FPM: rest</h1><?php echo phpinfo(); ?>" > /opt/rest/index.php \
&& chown -R www-data:www-data /opt/rest
RUN apt-get purge -y git \
&& apt-get autoremove -y
# needed for nginx
VOLUME ["/opt/rest/"]

View File

@ -52,7 +52,7 @@ if [[ "$mode" == "" || "$mode" == "--build" ]]; then
# budujemy nowy dom...
cd images/
for img in postgres php-fpm nginx pgadmin cron; do
for img in postgres php-fpm nginx pgadmin rest cron; do
# informujemy
echo -ne "\n\n - buduję: $prefix/$img\n"
# budujemy
@ -93,7 +93,6 @@ if [[ "$mode" == "" || "$mode" == "--populate-static-data" ]]; then
sudo mkdir "$static_data_dir/data/postgres"
sudo mkdir "$static_data_dir/data/php-fpm"
sudo mkdir "$static_data_dir/data/php-fpm/frontend"
sudo mkdir "$static_data_dir/data/php-fpm/rest"
sudo mkdir "$static_data_dir/data/php-fpm/ldapadmin"
sudo mkdir "$static_data_dir/data/cron"
sudo mkdir "$static_data_dir/data/cron/d"
@ -122,6 +121,7 @@ img_postgres="$prefix/postgres"
img_nginx="$prefix/nginx"
img_phpfpm="$prefix/php-fpm"
img_pgadmin="$prefix/pgadmin"
img_rest="$prefix/rest"
img_cron="$prefix/cron"
#
@ -135,14 +135,14 @@ cnt_nginx_public="$prefix-nginx.public"
cnt_nginx_internal="$prefix-nginx.internal"
# php-fpm
cnt_phpfpm_frontend="$prefix-php-fpm.frontend"
cnt_phpfpm_rest="$prefix-php-fpm.rest"
cnt_rest="$prefix-rest"
cnt_pgadmin="$prefix-pgadmin"
#cnt_phpfpm_ldapadmin="$prefix-ldapadmin"
# cron
cnt_cron="$prefix-cron"
# wszystkie
cnt_all="$cnt_postgres $cnt_nginx_public $cnt_nginx_internal $cnt_phpfpm_frontend $cnt_phpfpm_rest $cnt_pgadmin $cnt_phpfpm_ldapadmin $cnt_cron"
cnt_all="$cnt_postgres $cnt_nginx_public $cnt_nginx_internal $cnt_phpfpm_frontend $cnt_rest $cnt_pgadmin $cnt_phpfpm_ldapadmin $cnt_cron"
#
# stopujemy (w tym zawsze przy domyslnej akcji)
@ -195,13 +195,12 @@ if [[ "$mode" == "" || "$mode" == "--run" ]]; then
# - rest
docker run -d \
-v "$static_data_dir/data/php-fpm/rest/":/opt/php/rest/ \
-v "$static_data_dir/logs/php-fpm/":/var/log/php-fpm \
-v "$static_data_dir/run/php-fpm/":/var/run/php-fpm \
--link $cnt_postgres:$cnt_postgres \
-e "APP_NAME=rest" \
--name $cnt_phpfpm_rest \
$img_phpfpm
--name $cnt_rest \
$img_rest
# - pgadmin
docker run -d \
@ -238,6 +237,7 @@ if [[ "$mode" == "" || "$mode" == "--run" ]]; then
-v "$static_data_dir/run/php-fpm/":/var/run/php-fpm/ \
-v "$static_data_dir/data/php-fpm/":/opt/php/ \
--volumes-from $cnt_pgadmin \
--volumes-from $cnt_rest \
--name $cnt_nginx_internal \
$img_nginx

View File

@ -6,7 +6,7 @@ server {
listen 80;
server_name rest;
root /opt/php/rest;
root /opt/rest;
access_log /var/log/nginx/rest-access.log;
error_log /var/log/nginx/rest-error.log;

View File

@ -1,4 +0,0 @@
<h1>PHP-FPM: ldapadmin</h1>
<?php
echo phpinfo();
?>

View File

@ -1,4 +0,0 @@
<h1>PHP-FPM: rest</h1>
<?php
echo phpinfo();
?>