Skip to content

Commit

Permalink
Merge pull request #75 from bcgov/feature/descw-2657-allow-containers…
Browse files Browse the repository at this point in the history
…-to-access-wordpress

Feature/descw 2657 allow containers to access wordpress
  • Loading branch information
ShawnTurple authored Dec 2, 2024
2 parents 3a5d3aa + c4b41ad commit 6d991dc
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 4 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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))
Expand Down
2 changes: 1 addition & 1 deletion dev/bin/commands.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 $@
}

Expand Down
2 changes: 2 additions & 0 deletions dev/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
17 changes: 14 additions & 3 deletions openshift/templates/images/nginx/docker/local-dev.conf
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -30,8 +42,7 @@ server {
stub_status on;
access_log off;
log_not_found off;
allow 127.0.0.1;
deny all;

}

location ~ \.php$ {
Expand Down

0 comments on commit 6d991dc

Please sign in to comment.