diff --git a/CHANGELOG.md b/CHANGELOG.md index 32ecf68..f21e9fb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,8 @@ # Changelog +### December 2, 2024 +- allow access for WordPress local dev from within a local container ([DESCW-2657](https://citz-gdx.atlassian.net/browse/DESCW-2657)) +- removed $ROOT_PATH from wp command as it gave undesired results, and not required. + ### November 1, 2024 - update plugin/theme deployments ([DESCW-2691](https://citz-gdx.atlassian.net/browse/DESCW-2691)) - update images ([DESCW-2689](https://citz-gdx.atlassian.net/browse/DESCW-2689)) diff --git a/dev/bin/commands.sh b/dev/bin/commands.sh index 0ec4a8c..ea293a7 100644 --- a/dev/bin/commands.sh +++ b/dev/bin/commands.sh @@ -26,7 +26,7 @@ wp_stop() { # Access to the WordPress cli wp() { - cd $ROOT_PATH + #cd $ROOT_PATH docker exec -it dev-wp-cli-1 wp $@ } diff --git a/dev/docker-compose.yaml b/dev/docker-compose.yaml index 9523632..ba21316 100644 --- a/dev/docker-compose.yaml +++ b/dev/docker-compose.yaml @@ -14,6 +14,8 @@ services: context: ../openshift/templates/images/nginx/docker ports: - 443:443 + # This is to allow access to WordPress local deployment inside another container + - 38080:38080 links: - wordpress-php-fpm depends_on: diff --git a/openshift/templates/images/nginx/docker/local-dev.conf b/openshift/templates/images/nginx/docker/local-dev.conf index 78373fe..6d75f7a 100644 --- a/openshift/templates/images/nginx/docker/local-dev.conf +++ b/openshift/templates/images/nginx/docker/local-dev.conf @@ -1,7 +1,19 @@ +# This is to allow access to WordPress local development from within a container, as localhost 443 work work +# example curl http://host.docker.internal:38080/embc/wp-json/naad/v1/alert +server { + server_name bcgov.test; + listen 38080; + listen [::]:38080; + log_not_found off; + location / { + proxy_pass https://localhost; + } +} + server { index index.php index.html; server_name localhost; - listen 443 ssl; + listen 443 default_server ssl; listen [::]:443 ssl; error_log /dev/stderr; access_log /dev/stdout; @@ -30,8 +42,7 @@ server { stub_status on; access_log off; log_not_found off; - allow 127.0.0.1; - deny all; + } location ~ \.php$ {