title: Get database address with Docker
body: <p>I use docker-compose with the following <code>docker-compose.yml</code>:</p>
  
  <pre><code>web_db:
     image: mariadb:latest
     restart: always
     volumes:
      - ./var/mysql:/var/lib/mysql
     environment:
      MYSQL_ROOT_PASSWORD: X
      MYSQL_DATABASE: wordpress
      MYSQL_USER: wordpress
      MYSQL_PASSWORD: X
      MYSQL_ROOT_PASSWORD: X
  
  web_front:
    image: nginx
    restart: always
    ports:
      - 80:80
    links:
      - web_fpm
    volumes:
      - ./www:/var/www/html:rw
      - ./etc/nginx/nginx.conf:/etc/nginx/nginx.conf:ro
  
  web_fpm:
    build: ./PHP-FPM/
    restart: always
    links:
      - web_db:mysql
    volumes:
      - ./www:/var/www/html
  </code></pre>
  
  <p>When configuring Wordpress (manually downloaded in nginx root directory), I'm asked for the address of the database. I've tried <code>localhost</code>, but it doesn't work.</p>
  
  <p>PS: I know there are Wordpress images for Docker, but they have the full stack (nginx + PHP) and I don't like it, so don't propose them. ;)</p>