Skip to content

Commit

Permalink
Merge pull request #3 from cytopia/release-0.9
Browse files Browse the repository at this point in the history
REL-0.9 Remove deprecated options
  • Loading branch information
cytopia authored May 21, 2017
2 parents 141d610 + 21dd8db commit 7d108aa
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 45 deletions.
28 changes: 4 additions & 24 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ services:
env:
global:
- MY_DOCKER_NAME="my-httpd-docker"
- MYSQL_SOCKET_DIR=/tmp/mysql


###
Expand All @@ -40,7 +39,6 @@ install:
# Add html and php files
- echo "Static Html" > ~/www/index.html
- echo "<?php echo 'Helo world'; ?>" > ~/www/index.php
- echo "<?php error_reporting(-1); ini_set('display_errors', 1); if (mysqli_connect('localhost', 'root', '')) { echo 'YES'; } else { echo 'NO ' . mysqli_connect_error(); }" > ~/www/mysql_loc.php
- echo "<?php error_reporting(-1); ini_set('display_errors', 1); if (mysqli_connect('127.0.0.1', 'root', '')) { echo 'YES'; } else { echo 'NO ' . mysqli_connect_error(); }" > ~/www/mysql_127.php
- echo "<?php error_reporting(-1); ini_set('display_errors', 1); if (mysqli_connect('mysql', 'root', '')) { echo 'YES'; } else { echo 'NO ' . mysqli_connect_error(); }" > ~/www/mysql_rem.php
- echo "<?php error_reporting(-1); ini_set('display_errors', 1); if (mysqli_connect(gethostbyname('mysql'), 'root', '')) { echo 'YES'; } else { echo 'NO ' . mysqli_connect_error(); }" > ~/www/mysql_ip.php
Expand All @@ -55,6 +53,8 @@ before_script:
# http://docs.travis-ci.com/user/database-setup/#MySQL
- sudo /etc/init.d/mysql stop || true
- sudo /etc/init.d/postgresql stop || true
- sudo service mysql stop || true
- sudo service postgresql stop || true


###
Expand Down Expand Up @@ -209,9 +209,7 @@ script:
# MySQL
- docker run
-p 3306:3306
-v ~/tmp/host-mysql-sock:${MYSQL_SOCKET_DIR}
-e DEBUG_COMPOSE_ENTRYPOINT=1
-e MYSQL_SOCKET_DIR=${MYSQL_SOCKET_DIR}
-e MYSQL_ROOT_PASSWORD=
--network=my_bridge
--name mysql cytopia/mysql-5.5 &
Expand All @@ -220,14 +218,8 @@ script:
- docker run
-p 9000:9000
-v ~/www:/var/www/html
-v ~/tmp/host-mysql-sock:${MYSQL_SOCKET_DIR}
-e DEBUG_COMPOSE_ENTRYPOINT=1
-e FORWARD_MYSQL_PORT_TO_LOCALHOST=1
-e MYSQL_REMOTE_ADDR=mysql
-e MYSQL_REMOTE_PORT=3306
-e MYSQL_LOCAL_PORT=3306
-e MOUNT_MYSQL_SOCKET_TO_LOCALDISK=1
-e MYSQL_SOCKET_PATH=${MYSQL_SOCKET_DIR}/mysqld.sock
-e "FORWARD_PORTS_TO_LOCALHOST=3306:mysql:3306"
--network=my_bridge
--link mysql
--name php cytopia/php-fpm-5.6 &
Expand Down Expand Up @@ -265,12 +257,10 @@ script:
- curl http://localhost/index.php
- curl http://localhost/index.php | grep -q '<?php' && false || true

- curl http://localhost/mysql_loc.php
- curl http://localhost/mysql_127.php
- curl http://localhost/mysql_rem.php
- curl http://localhost/mysql_ip.php

- curl http://localhost/mysql_loc.php | grep 'YES'
- curl http://localhost/mysql_127.php | grep 'YES'
- curl http://localhost/mysql_rem.php | grep 'YES'
- curl http://localhost/mysql_ip.php | grep 'YES'
Expand All @@ -293,8 +283,6 @@ script:
# MySQL
- docker run
-p 3306:3306
-v ~/tmp/host-mysql-sock:${MYSQL_SOCKET_DIR}
-e MYSQL_SOCKET_DIR=${MYSQL_SOCKET_DIR}
-e MYSQL_ROOT_PASSWORD=
--network=my_bridge
--name mysql cytopia/mysql-5.5 &
Expand All @@ -303,13 +291,7 @@ script:
- docker run
-p 9000:9000
-v ~/www:/var/www/html
-v ~/tmp/host-mysql-sock:${MYSQL_SOCKET_DIR}
-e FORWARD_MYSQL_PORT_TO_LOCALHOST=1
-e MYSQL_REMOTE_ADDR=mysql
-e MYSQL_REMOTE_PORT=3306
-e MYSQL_LOCAL_PORT=3306
-e MOUNT_MYSQL_SOCKET_TO_LOCALDISK=1
-e MYSQL_SOCKET_PATH=${MYSQL_SOCKET_DIR}/mysqld.sock
-e "FORWARD_PORTS_TO_LOCALHOST=3306:mysql:3306"
--network=my_bridge
--link mysql
--name php cytopia/php-fpm-5.6 &
Expand Down Expand Up @@ -346,12 +328,10 @@ script:
- curl http://localhost/index.php
- curl http://localhost/index.php | grep -q '<?php' && false || true

- curl http://localhost/mysql_loc.php
- curl http://localhost/mysql_127.php
- curl http://localhost/mysql_rem.php
- curl http://localhost/mysql_ip.php

- curl http://localhost/mysql_loc.php | grep 'YES'
- curl http://localhost/mysql_127.php | grep 'YES'
- curl http://localhost/mysql_rem.php | grep 'YES'
- curl http://localhost/mysql_ip.php | grep 'YES'
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ LABEL \
image="nginx-stable" \
vendor="cytopia" \
license="MIT" \
build-date="2017-05-16"
build-date="2017-05-21"


# Copy scripts
Expand Down
26 changes: 6 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Nginx stable Docker

<small>**Latest build:** 2017-05-16</small>
<small>**Latest build:** 2017-05-21</small>

[![Build Status](https://travis-ci.org/cytopia/docker-nginx-stable.svg?branch=master)](https://travis-ci.org/cytopia/docker-nginx-stable) [![](https://images.microbadger.com/badges/version/cytopia/nginx-stable.svg)](https://microbadger.com/images/cytopia/nginx-stable "nginx-stable") [![](https://images.microbadger.com/badges/image/cytopia/nginx-stable.svg)](https://microbadger.com/images/cytopia/nginx-stable "nginx-stable") [![](https://images.microbadger.com/badges/license/cytopia/nginx-stable.svg)](https://microbadger.com/images/cytopia/nginx-stable "nginx-stable")

Expand Down Expand Up @@ -89,35 +89,21 @@ $ docker run -i \
Same as above, but also add a MySQL docker and link it into Nginx.
```bash
# Start the MySQL docker
# Make sure to
# 1. Set the socket dir, which will be needed by the PHP-FPM docker.
# 2. Mount the socket dir to the host, as it needs to be mounted by PHP-FPM
$ docker run -d \
-p 3306:3306 \
-v ~/tmp/host-mysql-sock:/tmp/docker-mysql-sock \
-e MYSQL_SOCKET_DIR=/tmp/docker-mysql-sock \
-e MYSQL_ROOT_PASSWORD=my-secret-pw \
--name mysql \
-t cytopia/mysql-5.5

# Start the PHP-FPM docker, mounting the same diectory.
# Also make sure to
# 1. mount the MySQL socket to local disk within the PHP-FPM docker
# in order to be able to use `localhost` for mysql connections from
# withing the php docker.
# 2. forward the remote MySQL port 3306 to 127.0.0.1:3306 within the
# PHP-FPM docker in order to be able to use `127.0.0.1` for mysq
# connections from within the php docker.
# forward the remote MySQL port 3306 to 127.0.0.1:3306 within the
# PHP-FPM docker in order to be able to use `127.0.0.1` for mysql
# connections from within the php docker.
$ docker run -d \
-p 9000:9000 \
-v ~/my-host-www:/var/www/html \
-v ~/tmp/host-mysql-sock:/tmp/docker-mysql-sock \
-e FORWARD_MYSQL_PORT_TO_LOCALHOST=1 \
-e MYSQL_REMOTE_ADDR=mysql \
-e MYSQL_REMOTE_PORT=3306 \
-e MYSQL_LOCAL_PORT=3306 \
-e MOUNT_MYSQL_SOCKET_TO_LOCALDISK=1 \
-e MYSQL_SOCKET_PATH=/tmp/docker-mysql-sock/mysqld.sock \
-e FORWARD_PORTS_TO_LOCALHOST=3306:mysql:3306 \
--name php \
cytopia/php-fpm-5.6

Expand All @@ -141,7 +127,7 @@ It offers pre-configured mass virtual hosts and an intranet.

It allows any of the following combinations:

* PHP 5.4, PHP 5.5, PHP 5.6, PHP 7.0 and PHP 7.1
* PHP 5.4, PHP 5.5, PHP 5.6, PHP 7.0, PHP 7.1 and HHVM
* MySQL 5.5, MySQL 5.6, MySQL 5.7, MariaDB 5 and MariaDB 10
* Apache 2.2, Apache 2.4, Nginx stable and Nginx mainline
* And more to come...
Expand Down

0 comments on commit 7d108aa

Please sign in to comment.