diff --git a/docker-compose.yml b/docker-compose.yml
index 520dcb3383..255b6c8a7c 100644
|
a
|
b
|
services: |
| 12 | 12 | - wpdevnet |
| 13 | 13 | |
| 14 | 14 | ports: |
| 15 | | - ${LOCAL_PORT-8889}:80 |
| | 15 | - ${LOCAL_PORT-8889}:${LOCAL_PORT-8889} |
| 16 | 16 | |
| 17 | 17 | environment: |
| 18 | 18 | LOCAL_DIR: ${LOCAL_DIR-src} |
| | 19 | LOCAL_PORT: ${LOCAL_PORT-8889} |
| 19 | 20 | |
| 20 | 21 | volumes: |
| 21 | 22 | - ./tools/local-env/default.template:/etc/nginx/conf.d/default.template |
| 22 | 23 | - ./:/var/www |
| 23 | 24 | |
| 24 | | # Load our config file, substituning environment variables into the config. |
| 25 | | command: /bin/sh -c "envsubst '$$LOCAL_DIR' < /etc/nginx/conf.d/default.template > /etc/nginx/conf.d/default.conf && exec nginx -g 'daemon off;'" |
| | 25 | # Load our config file, substituting environment variables into the config. |
| | 26 | command: /bin/sh -c "envsubst '$$LOCAL_DIR $$LOCAL_PORT' < /etc/nginx/conf.d/default.template > /etc/nginx/conf.d/default.conf && exec nginx -g 'daemon off;'" |
| 26 | 27 | |
| 27 | 28 | depends_on: |
| 28 | 29 | - php |
diff --git a/tools/local-env/default.template b/tools/local-env/default.template
index 21bfac0e1f..310f996882 100644
|
a
|
b
|
|
| 1 | 1 | server { |
| 2 | 2 | index index.php index.html; |
| 3 | 3 | |
| 4 | | listen 80 default_server; |
| 5 | | listen [::]:80 default_server; |
| | 4 | listen ${LOCAL_PORT} default_server; |
| | 5 | listen [::]:${LOCAL_PORT} default_server; |
| 6 | 6 | |
| 7 | 7 | server_name localhost; |
| 8 | 8 | |