Skip to content

Commit

Permalink
[TASK] Make document root configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
Benedikt Schmitz committed Jul 6, 2017
1 parent 421938e commit 709658f
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 7 deletions.
3 changes: 2 additions & 1 deletion .env
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ MYSQL_USER=neos
MYSQL_PASSWORD=neos

FLOW_CONTEXT=Development/Docker
NGINX_PORT=1234
NGINX_PORT=1234
NGINX_DOCUMENT_ROOT=/data/Web
2 changes: 1 addition & 1 deletion Docker/nginx/default.conf.template
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
server {
listen ${NGINX_PORT};
server_name localhost;
root /data/Web;
root ${NGINX_DOCUMENT_ROOT};
index index.php;

client_body_temp_path /tmp/nginx;
Expand Down
2 changes: 1 addition & 1 deletion Docker/nginx/run_nginx.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
set -e
set -u

envsubst '${FLOW_CONTEXT} ${NGINX_PORT}' < /default.conf.template > /etc/nginx/conf.d/default.conf
envsubst '${FLOW_CONTEXT} ${NGINX_PORT} ${NGINX_DOCUMENT_ROOT}' < /default.conf.template > /etc/nginx/conf.d/default.conf
nginx -g "daemon off;"
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,4 @@ If you want a different port than 1234 you can edit the environment variable `NG

### How to change the document root?

To change the document root just edit the configuration file located under `Docker/nginx/default.conf.template`
To change the document root just edit the environment variable `NGINX_DOCUMENT_ROOT` in the [.env](https://github.com/egobude/docker-neos-template/blob/master/.env) file.
7 changes: 4 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ services:
environment:
FLOW_CONTEXT: "${FLOW_CONTEXT}"
volumes:
- "./Data:/data:cached"
- "./Data:/data"

nginx:
build: ./Docker/nginx
Expand All @@ -21,9 +21,10 @@ services:
environment:
FLOW_CONTEXT: "${FLOW_CONTEXT}"
NGINX_PORT: "${NGINX_PORT}"
NGINX_DOCUMENT_ROOT: "${NGINX_DOCUMENT_ROOT}"
command: /bin/sh -c "/run_nginx.sh"
volumes:
- "./Data:/data"
volumes_from:
- php

redis:
build: ./Docker/redis
Expand Down

0 comments on commit 709658f

Please sign in to comment.