Skip to content

Commit ccc7ca0

Browse files
authored
Merge pull request #3 from cytopia/release-0.9
Release 0.9
2 parents d1f4b84 + eed802f commit ccc7ca0

File tree

3 files changed

+12
-45
lines changed

3 files changed

+12
-45
lines changed

.travis.yml

Lines changed: 4 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ services:
1515
env:
1616
global:
1717
- MY_DOCKER_NAME="my-httpd-docker"
18-
- MYSQL_SOCKET_DIR=/tmp/mysql
1918

2019

2120
###
@@ -40,7 +39,6 @@ install:
4039
# Add html and php files
4140
- echo "Static Html" > ~/www/index.html
4241
- echo "<?php echo 'Helo world'; ?>" > ~/www/index.php
43-
- 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
4442
- 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
4543
- 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
4644
- 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
@@ -55,6 +53,8 @@ before_script:
5553
# http://docs.travis-ci.com/user/database-setup/#MySQL
5654
- sudo /etc/init.d/mysql stop || true
5755
- sudo /etc/init.d/postgresql stop || true
56+
- sudo service mysql stop || true
57+
- sudo service postgresql stop || true
5858

5959

6060
###
@@ -209,9 +209,7 @@ script:
209209
# MySQL
210210
- docker run
211211
-p 3306:3306
212-
-v ~/tmp/host-mysql-sock:${MYSQL_SOCKET_DIR}
213212
-e DEBUG_COMPOSE_ENTRYPOINT=1
214-
-e MYSQL_SOCKET_DIR=${MYSQL_SOCKET_DIR}
215213
-e MYSQL_ROOT_PASSWORD=
216214
--network=my_bridge
217215
--name mysql cytopia/mysql-5.5 &
@@ -220,14 +218,8 @@ script:
220218
- docker run
221219
-p 9000:9000
222220
-v ~/www:/var/www/html
223-
-v ~/tmp/host-mysql-sock:${MYSQL_SOCKET_DIR}
224221
-e DEBUG_COMPOSE_ENTRYPOINT=1
225-
-e FORWARD_MYSQL_PORT_TO_LOCALHOST=1
226-
-e MYSQL_REMOTE_ADDR=mysql
227-
-e MYSQL_REMOTE_PORT=3306
228-
-e MYSQL_LOCAL_PORT=3306
229-
-e MOUNT_MYSQL_SOCKET_TO_LOCALDISK=1
230-
-e MYSQL_SOCKET_PATH=${MYSQL_SOCKET_DIR}/mysqld.sock
222+
-e "FORWARD_PORTS_TO_LOCALHOST=3306:mysql:3306"
231223
--network=my_bridge
232224
--link mysql
233225
--name php cytopia/php-fpm-5.6 &
@@ -265,12 +257,10 @@ script:
265257
- curl http://localhost/index.php
266258
- curl http://localhost/index.php | grep -q '<?php' && false || true
267259

268-
- curl http://localhost/mysql_loc.php
269260
- curl http://localhost/mysql_127.php
270261
- curl http://localhost/mysql_rem.php
271262
- curl http://localhost/mysql_ip.php
272263

273-
- curl http://localhost/mysql_loc.php | grep 'YES'
274264
- curl http://localhost/mysql_127.php | grep 'YES'
275265
- curl http://localhost/mysql_rem.php | grep 'YES'
276266
- curl http://localhost/mysql_ip.php | grep 'YES'
@@ -293,8 +283,6 @@ script:
293283
# MySQL
294284
- docker run
295285
-p 3306:3306
296-
-v ~/tmp/host-mysql-sock:${MYSQL_SOCKET_DIR}
297-
-e MYSQL_SOCKET_DIR=${MYSQL_SOCKET_DIR}
298286
-e MYSQL_ROOT_PASSWORD=
299287
--network=my_bridge
300288
--name mysql cytopia/mysql-5.5 &
@@ -303,13 +291,7 @@ script:
303291
- docker run
304292
-p 9000:9000
305293
-v ~/www:/var/www/html
306-
-v ~/tmp/host-mysql-sock:${MYSQL_SOCKET_DIR}
307-
-e FORWARD_MYSQL_PORT_TO_LOCALHOST=1
308-
-e MYSQL_REMOTE_ADDR=mysql
309-
-e MYSQL_REMOTE_PORT=3306
310-
-e MYSQL_LOCAL_PORT=3306
311-
-e MOUNT_MYSQL_SOCKET_TO_LOCALDISK=1
312-
-e MYSQL_SOCKET_PATH=${MYSQL_SOCKET_DIR}/mysqld.sock
294+
-e "FORWARD_PORTS_TO_LOCALHOST=3306:mysql:3306"
313295
--network=my_bridge
314296
--link mysql
315297
--name php cytopia/php-fpm-5.6 &
@@ -346,12 +328,10 @@ script:
346328
- curl http://localhost/index.php
347329
- curl http://localhost/index.php | grep -q '<?php' && false || true
348330

349-
- curl http://localhost/mysql_loc.php
350331
- curl http://localhost/mysql_127.php
351332
- curl http://localhost/mysql_rem.php
352333
- curl http://localhost/mysql_ip.php
353334

354-
- curl http://localhost/mysql_loc.php | grep 'YES'
355335
- curl http://localhost/mysql_127.php | grep 'YES'
356336
- curl http://localhost/mysql_rem.php | grep 'YES'
357337
- curl http://localhost/mysql_ip.php | grep 'YES'

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ LABEL \
1313
image="nginx-mainline" \
1414
vendor="cytopia" \
1515
license="MIT" \
16-
build-date="2017-05-16"
16+
build-date="2017-05-21"
1717

1818

1919
# Copy scripts

README.md

Lines changed: 7 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Nginx mainline Docker
22

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

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

@@ -83,40 +83,27 @@ $ docker run -i \
8383
-t cytopia/nginx-mainline
8484
```
8585

86+
8687
**3. Fully functional LEMP stack**
8788

8889
Same as above, but also add a MySQL docker and link it into Nginx.
8990
```bash
9091
# Start the MySQL docker
91-
# Make sure to
92-
# 1. Set the socket dir, which will be needed by the PHP-FPM docker.
93-
# 2. Mount the socket dir to the host, as it needs to be mounted by PHP-FPM
9492
$ docker run -d \
9593
-p 3306:3306 \
96-
-v ~/tmp/host-mysql-sock:/tmp/docker-mysql-sock \
97-
-e MYSQL_SOCKET_DIR=/tmp/docker-mysql-sock \
9894
-e MYSQL_ROOT_PASSWORD=my-secret-pw \
9995
--name mysql \
10096
-t cytopia/mysql-5.5
10197

10298
# Start the PHP-FPM docker, mounting the same diectory.
10399
# Also make sure to
104-
# 1. mount the MySQL socket to local disk within the PHP-FPM docker
105-
# in order to be able to use `localhost` for mysql connections from
106-
# withing the php docker.
107-
# 2. forward the remote MySQL port 3306 to 127.0.0.1:3306 within the
108-
# PHP-FPM docker in order to be able to use `127.0.0.1` for mysq
109-
# connections from within the php docker.
100+
# forward the remote MySQL port 3306 to 127.0.0.1:3306 within the
101+
# PHP-FPM docker in order to be able to use `127.0.0.1` for mysql
102+
# connections from within the php docker.
110103
$ docker run -d \
111104
-p 9000:9000 \
112105
-v ~/my-host-www:/var/www/html \
113-
-v ~/tmp/host-mysql-sock:/tmp/docker-mysql-sock \
114-
-e FORWARD_MYSQL_PORT_TO_LOCALHOST=1 \
115-
-e MYSQL_REMOTE_ADDR=mysql \
116-
-e MYSQL_REMOTE_PORT=3306 \
117-
-e MYSQL_LOCAL_PORT=3306 \
118-
-e MOUNT_MYSQL_SOCKET_TO_LOCALDISK=1 \
119-
-e MYSQL_SOCKET_PATH=/tmp/docker-mysql-sock/mysqld.sock \
106+
-e FORWARD_PORTS_TO_LOCALHOST=3306:mysql:3306 \
120107
--name php \
121108
cytopia/php-fpm-5.6
122109

@@ -140,7 +127,7 @@ It offers pre-configured mass virtual hosts and an intranet.
140127

141128
It allows any of the following combinations:
142129

143-
* PHP 5.4, PHP 5.5, PHP 5.6, PHP 7.0 and PHP 7.1
130+
* PHP 5.4, PHP 5.5, PHP 5.6, PHP 7.0, PHP 7.1 and HHVM
144131
* MySQL 5.5, MySQL 5.6, MySQL 5.7, MariaDB 5 and MariaDB 10
145132
* Apache 2.2, Apache 2.4, Nginx stable and Nginx mainline
146133
* And more to come...

0 commit comments

Comments
 (0)