Skip to content

Commit 1e29758

Browse files
committed
REL-0.10 Consolidate conf dirs with other httpd Docker
1 parent 951846e commit 1e29758

File tree

8 files changed

+21
-21
lines changed

8 files changed

+21
-21
lines changed

Dockerfile

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ LABEL \
1010
image="nginx-mainline" \
1111
vendor="cytopia" \
1212
license="MIT" \
13-
build-date="2017-09-27"
13+
build-date="2017-09-28"
1414

1515

1616
###
@@ -20,6 +20,7 @@ LABEL \
2020
# required packages
2121
RUN set -x \
2222
&& apt-get update \
23+
&& apt-get upgrade -y \
2324
&& apt-get install --no-install-recommends --no-install-suggests -y \
2425
make \
2526
python-yaml \
@@ -48,18 +49,19 @@ RUN set -x \
4849
&& apt-get remove -y \
4950
make \
5051
wget \
52+
&& apt-get autoremove -y \
5153
&& rm -rf /var/lib/apt/lists/* \
5254
&& apt-get purge -y --auto-remove
5355

5456
# Add custom config directive to httpd server
5557
RUN set -x \
56-
&& sed -i'' 's|^\s*include.*conf\.d/.*| include /etc/nginx-mainline.d/*.conf;\n include /etc/nginx/conf.d/*.conf;\n include /etc/nginx/custom.d/*.conf;\n|g' /etc/nginx/nginx.conf
58+
&& sed -i'' 's|^\s*include.*conf\.d/.*| include /etc/httpd-custom.d/*.conf;\n include /etc/httpd/conf.d/*.conf;\n include /etc/httpd/vhost.d/*.conf;\n|g' /etc/nginx/nginx.conf
5759

5860
# create directories
5961
RUN set -x \
60-
&& rm -rf /etc/nginx/conf.d/* \
61-
&& mkdir -p /etc/nginx-mainline.d \
62-
&& mkdir -p /etc/nginx/custom.d \
62+
&& mkdir -p /etc/httpd-custom.d \
63+
&& mkdir -p /etc/httpd/conf.d \
64+
&& mkdir -p /etc/httpd/vhost.d \
6365
&& mkdir -p /var/www/default/htdocs \
6466
&& mkdir -p /shared/httpd \
6567
&& chmod 0775 /shared/httpd \

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Find me on **[Docker Hub](https://hub.docker.com/r/cytopia/nginx-mainline)**:
1818

1919
[![cytopia/nginx-mainline](http://dockeri.co/image/cytopia/nginx-mainline)](https://hub.docker.com/r/cytopia/nginx-mainline/)
2020

21-
<small>**Latest build:** 2017-09-27</small>
21+
<small>**Latest build:** 2017-09-28</small>
2222

2323
----
2424

@@ -120,7 +120,7 @@ This Docker container adds a lot of injectables in order to customize it to your
120120
| DEBUG_RUNTIME | bool | `0` | Be verbose during runtime.<br/>Value: `0` or `1` |
121121
| DOCKER_LOGS | bool | `0` | When set to `1` will redirect error and access logs to Docker logs (`stderr` and `stdout`) instead of file inside container.<br/>Value: `0` or `1` |
122122
| TIMEZONE | string | `UTC` | Set docker OS timezone.<br/>(Example: `Europe/Berlin`) |
123-
| NEW_UID | int | `101` | Assign the default nginx user a new UID. This is useful if you you mount your document root and want to match the file permissions to the one of your local user. Set it to your host users uid (see `id` for your uid). |
123+
| NEW_UID | int | `101` | Assign the default Nginx user a new UID. This is useful if you you mount your document root and want to match the file permissions to the one of your local user. Set it to your host users uid (see `id` for your uid). |
124124
| NEW_GID | int | `101` | This is useful if you you mount your document root and want to match the file permissions to the one of your local user group. Set it to your host user groups gid (see `id` for your gid). |
125125
| PHP_FPM_ENABLE | bool | `0` | Enable PHP-FPM for the default vhost and the mass virtual hosts. |
126126
| PHP_FPM_SERVER_ADDR | string | `` | IP address or hostname of remote PHP-FPM server.<br/><strong>Required when enabling PHP.</strong> |
@@ -150,7 +150,7 @@ This Docker container adds a lot of injectables in order to customize it to your
150150

151151
| Docker | Description |
152152
|---------------------|-------------|
153-
| /etc/nginx-stable.d | Mount this directory to add outside configuration files (`*.conf`) to nginx |
153+
| /etc/httpd-custom.d | Mount this directory to add outside configuration files (`*.conf`) to Nginx |
154154
| /var/www/default | Nginx default virtual host base path (contains by default `htdocs/` and `cfg/` |
155155
| /shared/httpd | Nginx mass virtual host root directory |
156156

@@ -175,7 +175,7 @@ $ docker run -d -p 80:80 -v ~/my-host-www:/var/www/default -t cytopia/nginx-main
175175

176176
#### 2. Serve PHP files with PHP-FPM
177177

178-
Note, for this to work, the `~/my-host-www` dir must be mounted into the nginx docker as well as into the php-fpm docker.
178+
Note, for this to work, the `~/my-host-www` dir must be mounted into the Nginx Docker as well as into the php-fpm docker.
179179

180180
You can also attach other PHP-FPM version: [PHP-FPM 5.4](https://github.com/cytopia/docker-php-fpm-5.4), [PHP-FPM 5.5](https://github.com/cytopia/docker-php-fpm-5.5), [PHP-FPM 5.6](https://github.com/cytopia/docker-php-fpm-5.6), [PHP-FPM 7.0](https://github.com/cytopia/docker-php-fpm-7.0) or [PHP-FPM 7.1](https://github.com/cytopia/docker-php-fpm-7.1)
181181

@@ -185,7 +185,7 @@ Each PHP-FPM docker also has the option to enable Xdebug and more, see their res
185185
# Start the PHP-FPM docker, mounting the same diectory
186186
$ docker run -d -p 9000 -v ~/my-host-www:/var/www/default --name php cytopia/php-fpm-5.6
187187

188-
# Start the Nginx docker, linking it to the PHP-FPM docker
188+
# Start the Nginx Docker, linking it to the PHP-FPM docker
189189
$ docker run -d \
190190
-p 80:80 \
191191
-v ~/my-host-www:/var/www/default \
@@ -219,7 +219,7 @@ $ docker run -d \
219219
--name php \
220220
cytopia/php-fpm-5.6
221221

222-
# Start the Nginx docker, linking it to the PHP-FPM docker
222+
# Start the Nginx Docker, linking it to the PHP-FPM docker
223223
$ docker run -d \
224224
-p 80:80 \
225225
-v ~/my-host-www:/var/www/default \

build/docker-build.sh

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,9 @@ run "docker build -t cytopia/${NAME} ${CWD}"
6363
###
6464
### Retrieve information afterwards and Update README.md
6565
###
66-
docker run -d --name my_tmp_${NAME} -t cytopia/${NAME}
66+
docker run -d --rm --name my_tmp_${NAME} -t cytopia/${NAME}
6767
INFO="$( docker exec my_tmp_${NAME} nginx -V 2>&1 | grep -E '^(nginx|built|TLS)' )"
68-
docker stop "$(docker ps | grep "my_tmp_${NAME}" | awk '{print $1}')"
69-
docker rm "my_tmp_${NAME}"
68+
docker stop "$(docker ps | grep "my_tmp_${NAME}" | awk '{print $1}')" > /dev/null
7069

7170
INFO="$( echo "${INFO}" | sed 's/\s$//g' )" # remove trailing space
7271
echo "${INFO}"

build/docker-rebuild.sh

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,9 @@ run "docker build --no-cache -t cytopia/${NAME} ${CWD}"
6363
###
6464
### Retrieve information afterwards and Update README.md
6565
###
66-
docker run -d --name my_tmp_${NAME} -t cytopia/${NAME}
66+
docker run -d --rm --name my_tmp_${NAME} -t cytopia/${NAME}
6767
INFO="$( docker exec my_tmp_${NAME} nginx -V 2>&1 | grep -E '^(nginx|built|TLS)' )"
68-
docker stop "$(docker ps | grep "my_tmp_${NAME}" | awk '{print $1}')"
69-
docker rm "my_tmp_${NAME}"
68+
docker stop "$(docker ps | grep "my_tmp_${NAME}" | awk '{print $1}')" > /dev/null
7069

7170
INFO="$( echo "${INFO}" | sed 's/\s$//g' )" # remove trailing space
7271
echo "${INFO}"

data/docker-entrypoint.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ if [ "${_RUNTIME_MAIN_VHOST_STATUS_ENABLE}" -eq "1" ]; then
266266
if ! set | grep '^MAIN_VHOST_STATUS_ALIAS=' >/dev/null 2>&1; then
267267
log "info" "\$MAIN_VHOST_STATUS_ALIAS not specified. Keeping default: ${_RUNTIME_MAIN_VHOST_STATUS_ALIAS}."
268268
else
269-
log "info" "Setting httpd status page to: '\$MAIN_VHOST_STATUS_ALIAS'"
269+
log "info" "Setting httpd status page to: '${MAIN_VHOST_STATUS_ALIAS}'"
270270
_RUNTIME_MAIN_VHOST_STATUS_ALIAS="${MAIN_VHOST_STATUS_ALIAS}"
271271
fi
272272
fi

data/supervisord.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ stdout_events_enabled=true
1414
stderr_events_enabled=true
1515

1616
[program:watcherd]
17-
command=watcherd -v -p /shared/httpd -a "vhost_gen.py -p %%p -n %%n -o %%p/__MASS_VHOST_TPL__/ -s __VERBOSE__" -d "rm /etc/nginx/custom.d/%%n.conf" -t "nginx -s reload"
17+
command=watcherd -v -p /shared/httpd -a "vhost_gen.py -p %%p -n %%n -o %%p/__MASS_VHOST_TPL__/ -s __VERBOSE__" -d "rm /etc/httpd/vhost.d/%%n.conf" -t "nginx -s reload"
1818
#startsecs = 0
1919
#autorestart = false
2020
#startretries = 1

data/vhost-gen/conf.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ server: nginx
5151
# Where to store the generated configuration files.
5252
# This must be a directory the web server will read
5353
# configuration files from.
54-
conf_dir: /etc/nginx/custom.d
54+
conf_dir: /etc/httpd/vhost.d
5555

5656
# Vhost definition
5757
vhost:

data/vhost-gen/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ server: nginx
5151
# Where to store the generated configuration files.
5252
# This must be a directory the web server will read
5353
# configuration files from.
54-
conf_dir: /etc/nginx/conf.d
54+
conf_dir: /etc/httpd/conf.d
5555

5656
# Vhost definition
5757
vhost:

0 commit comments

Comments
 (0)