Skip to content

Commit

Permalink
update php7
Browse files Browse the repository at this point in the history
  • Loading branch information
Aimsam committed Sep 29, 2016
1 parent 52628e0 commit ab27c54
Show file tree
Hide file tree
Showing 17 changed files with 130 additions and 72,863 deletions.
11 changes: 7 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
.composer/cache/*
mount/data/mysql/*
mount/var/log/*
mount/var/log/*
mount/var/log/nginx/*
mount/etc/nginx/sites-available/*
mount/etc/nginx/sites-enable/*
!mount/etc/nginx/sites-enable/default
!mount/etc/nginx/sites-available/default
mount/var/log/mysql/*
images/php/7/local/*
!.gitkeep
docker-compose.yml
49 changes: 29 additions & 20 deletions docker-compose.yml → docker-compose-mac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,39 +4,48 @@ mysql:
container_name: mysql
ports:
- '3306:3306'
expose:
- '3306'
volumes:
- /mnt/sda1/volumes/mysql:/var/lib/mysql
- $PWD/mount/data/mysql:/var/lib/mysql
environment:
- MYSQL_ROOT_PASSWORD=123456
MYSQL_ROOT_PASSWORD: 123456
TZ: Asia/Chongqing

redis:
image: redis:alpine
container_name: redis
ports:
- "6379:6379"
volumes:
- $PWD/data/redis:/data
- ./etc/redis/redis.conf:/etc/redis.conf
command: ["redis-server", "/etc/redis.conf"]
environment:
TZ: Asia/Chongqing
restart: always

php:
restart: always
image: aimsam/php-fpm
image: aimsam/php7
container_name: php
links:
- mysql
- redis
ports:
- '9000:9000'
expose:
- '9000'
volumes:
- $PWD/mount/var/log:/var/log
- ~/Projects:/var/htdocs
- $PWD/mount/usr/local/bin:/usr/local/bin
- $PWD/mount/.composer:/root/.composer
postgres:
restart: always
image: postgres
container_name: postgres
ports:
- '5432:5432'
volumes:
- /mnt/sda1/volumes/postgresql:/var/lib/postgresql/data
- $PWD/images/php/7/local:/home/work/local
environment:
- POSTGRES_PASSWORD=123456
TZ: Asia/Chongqing
REDIS_PORT: 6379

nginx:
restart: always
image: aimsam/nginx
container_name: nginx
image: nginx:alpine
container_name: nginx
links:
- php
ports:
- '80:80'
- '433:433'
Expand Down
11 changes: 0 additions & 11 deletions images/boot2docker/Dockerfile

This file was deleted.

4 changes: 0 additions & 4 deletions images/boot2docker/makefile

This file was deleted.

9 changes: 0 additions & 9 deletions images/boot2docker/nfs-server.sh

This file was deleted.

41 changes: 0 additions & 41 deletions images/php-fpm/Dockerfile

This file was deleted.

43 changes: 43 additions & 0 deletions images/php/5/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# VERSION 0.0.1
FROM ubuntu:14.04
MAINTAINER aimsam<[email protected]>

# install packages
RUN apt-get update && \
apt-get upgrade -y && \
apt-get install -y software-properties-common && \
locale-gen en_US.UTF-8 && \
export LANG=en_US.UTF-8 && \
apt-add-repository -y ppa:ondrej/php5-5.6 && \
apt-get update && \
apt-get install -y php5-fpm php5-curl php5-mysqlnd php5-mcrypt php5-gd php5-pgsql php5-memcached git && \
rm -rf /var/lib/apt/lists/*

# connfiguration
RUN sed -E -i "s/^listen\ =.+?$/listen = 0.0.0.0:9000/" /etc/php5/fpm/pool.d/www.conf && \
sed -E -i "s/^pm\ =.+?$/pm = ondemand/" /etc/php5/fpm/pool.d/www.conf && \
sed -E -i "s/^pm\.max_children\ =.+?$/pm\.max_children = 2/" /etc/php5/fpm/pool.d/www.conf && \
sed -E -i "s/^;pm\.process_idle_timeout\ =.+?$/pm\.process_idle_timeout=10s/" /etc/php5/fpm/pool.d/www.conf && \
sed -E -i "s/^error_log\ =.+?$/error_log = \/dev\/stdout/" /etc/php5/fpm/php-fpm.conf && \
sed -E -i "s/^post_max_size\ =.+?$/post_max_size = 100M/" /etc/php5/fpm/php.ini && \
sed -E -i "s/^upload_max_filesize\ =.+?$/upload_max_filesize = 100M/" /etc/php5/fpm/php.ini

# for development
RUN sed -E -i "s/^display_errors\ .+?$/display_errors = On/" /etc/php5/fpm/php.ini && \
sed -E -i "s/^error_reporting\ .+?$/error_reporting = E_ALL \& \~E_DEPRECATED \& \~E_STRICT \& \~E_NOTICE/" /etc/php5/fpm/php.ini

# phpunit & composer
ADD https://phar.phpunit.de/phpunit.phar /usr/local/bin/phpunit
ADD https://getcomposer.org/composer.phar /usr/local/bin/composer

COPY docker-entrypoint.sh /entrypoint.sh
RUN chmod +x /usr/local/bin/phpunit /usr/local/bin/composer /entrypoint.sh && \
mkdir /var/htdocs && \
chown -R www-data:www-data /var/htdocs

WORKDIR /var/htdocs
ENTRYPOINT ["/entrypoint.sh"]

EXPOSE 9000

CMD ["php5-fpm", "-F"]
5 changes: 5 additions & 0 deletions images/php/5/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
build:
docker build -t aimsam/php5 .

clean:
docker rmi aimsam/php5
15 changes: 15 additions & 0 deletions images/php/5/docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash
set -e
if [ ! -d /root/.ssh ]
then
mkdir /root/.ssh
chmod 700 /root/.ssh
fi

if [ -d /root/ssh-outside ]
then
cp -rf /root/ssh-outside/* /root/.ssh
chmod 600 /root/.ssh/*
fi

exec "$@"
21 changes: 21 additions & 0 deletions images/php/7/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# VERSION 0.0.1
FROM aimsam/ubuntu
MAINTAINER aimsam<[email protected]>

#VOLUME $PWD/local/:/home/work/local
# phpunit & composer
ADD https://phar.phpunit.de/phpunit.phar /usr/local/bin/phpunit
ADD https://getcomposer.org/composer.phar /usr/local/bin/composer

COPY docker-entrypoint.sh /entrypoint.sh
RUN chmod +x /usr/local/bin/phpunit /usr/local/bin/composer /entrypoint.sh && \
mkdir /var/htdocs && \
chown -R www-data:www-data /var/htdocs

WORKDIR /var/htdocs
ENTRYPOINT ["/entrypoint.sh"]


EXPOSE 9000

CMD /home/work/local/php-7.0.6/sbin/php-fpm -F
5 changes: 5 additions & 0 deletions images/php/7/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
build:
docker build -t aimsam/php7 .

clean:
docker rmi aimsam/php7
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions mount/etc/redis/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
redis.conf
4 changes: 4 additions & 0 deletions mount/etc/redis/redis.sample.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
requirepass foobared
save 900 1
save 300 10
save 60 10000
Binary file removed mount/usr/local/bin/composer
Binary file not shown.
Loading

0 comments on commit ab27c54

Please sign in to comment.