I have this docker-compose file that deploys my 3 services
version: '3'
services:
db:
image: mariadb:10.3.9
volumes:
- data:/var/lib/mysql
environment:
- MYSQL_ROOT_PASSWORD=secret
- MYSQL_DATABASE=wordpress
- MYSQL_USER=manager
- MYSQL_PASSWORD=secret
wp:
image: wordpress:4.9.8
depends_on:
- db
volumes:
- ./target:/var/www/html
environment:
- WORDPRESS_DB_USER=manager
- WORDPRESS_DB_PASSWORD=secret
- WORDPRESS_DB_HOST=db
ports:
- "80"
#deploy:
#mode: replicated
#replicas: 3
lb:
image: nginx:latest
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf
depends_on:
- wp
ports:
- "8080:80"
volumes:
data:
You can escalate to more than 1 wordpress any time you want, just uncommenting that. The idea is to have 3 exact same wp and nginx as load balancer.
My nginx.conf is like this
user nginx;
events {
worker_connections 1000;
}
http {
server {
listen 80;
location / {
proxy_pass http://wp:80;
}
}
Now if I go to localhost:8080 the url resolves to http://wp/wp-admin/install.php but the web is blank and I can’t connect. What did I do wrong?