Skip to main content
Post Undeleted by Manumie
deleted 1003 characters in body; added 97 characters in body
Source Link
Manumie
  • 43
  • 2
  • 10

I found my mistake (funny how helpfulActually it is to post a questionwas the quote : it makes you look at your problemI set the environment variable for the db with a new eye).

My aliasesquotes, that are not correctescaped by phpmyadmin, so instead of connecting to host db it tries to connect to 'db' :

web: image: nginx networks: app_net: aliases: - wordpressPMA_HOST='db' 

It means that my nginx server is aliased wordpress on the app_net network.

If I set my upstream as

upstream backend { server wordpress:9000; } 

Nginx tries to proxy php requests on its own port 9000, which can't work.

Here's the correct setupshould be (only the relevant stuff):

services: blog: (skip) networks: - maria_net - app_net db: (skip) networks: - maria_net web: (skip) networks: - app_net networks: app_net:  maria_net:PMA_HOST=db 

Since I'm no longer using aliasesThat was a pretty lame problem, I need to update the upstream with the service name (Docker takes care of making containers onbut the same net visible to each other under their service name) :

upstream backend { server blog:9000; } 

Now I can hit my Wordpress app on :8080.

whole thing about networks in Compose isn't too clear, and I hope that finally getting a working conf will now try to connect my phpMyAdmin containerhelp others.

I found my mistake (funny how helpful it is to post a question : it makes you look at your problem with a new eye).

My aliases are not correct :

web: image: nginx networks: app_net: aliases: - wordpress 

It means that my nginx server is aliased wordpress on the app_net network.

If I set my upstream as

upstream backend { server wordpress:9000; } 

Nginx tries to proxy php requests on its own port 9000, which can't work.

Here's the correct setup (only the relevant stuff)

services: blog: (skip) networks: - maria_net - app_net db: (skip) networks: - maria_net web: (skip) networks: - app_net networks: app_net:  maria_net: 

Since I'm no longer using aliases, I need to update the upstream with the service name (Docker takes care of making containers on the same net visible to each other under their service name) :

upstream backend { server blog:9000; } 

Now I can hit my Wordpress app on :8080.

I will now try to connect my phpMyAdmin container.

Actually it was the quote : I set the environment variable for the db with quotes, that are escaped by phpmyadmin, so instead of connecting to host db it tries to connect to 'db' :

- PMA_HOST='db' 

It should be :

- PMA_HOST=db 

That was a pretty lame problem, but the whole thing about networks in Compose isn't too clear, and I hope that finally getting a working conf will help others.

Post Deleted by Manumie
Source Link
Manumie
  • 43
  • 2
  • 10

I found my mistake (funny how helpful it is to post a question : it makes you look at your problem with a new eye).

My aliases are not correct :

web: image: nginx networks: app_net: aliases: - wordpress 

It means that my nginx server is aliased wordpress on the app_net network.

If I set my upstream as

upstream backend { server wordpress:9000; } 

Nginx tries to proxy php requests on its own port 9000, which can't work.

Here's the correct setup (only the relevant stuff)

services: blog: (skip) networks: - maria_net - app_net db: (skip) networks: - maria_net web: (skip) networks: - app_net networks: app_net: maria_net: 

Since I'm no longer using aliases, I need to update the upstream with the service name (Docker takes care of making containers on the same net visible to each other under their service name) :

upstream backend { server blog:9000; } 

Now I can hit my Wordpress app on :8080.

I will now try to connect my phpMyAdmin container.