Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/descw 2657 allow containers to access wordpress #75

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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