chriszarate / docker-compose-wordpress

An example Docker Compose setup for WordPress plugin or theme development.
162 stars 54 forks source link

503 Service Temporarily Unavailable - nginx #10

Closed Richi2293 closed 6 years ago

Richi2293 commented 6 years ago

Hi,

I'm trying this docker compose but always return me this error on localhost:

image

I'm on macOS 10.12.6 I followed the instructions in "Set up".

This is my docker-compose file: ('plugin-folder' is my plugin file)

version: "2"

services:
  wordpress:
    image: "chriszarate/wordpress:4.9.1"
    environment:
      VIRTUAL_HOST: "${DOCKER_DEV_DOMAIN}"
      WORDPRESS_ACTIVATE_PLUGINS: "plugin-folder" # plugin folder relative to /wp-content/plugins/
      WORDPRESS_ACTIVATE_THEME: ""   # theme folder relative to /wp-content/themes/
      WORDPRESS_SITE_TITLE: "Project"
      WORDPRESS_SITE_URL: "http://${DOCKER_DEV_DOMAIN}"
      # XDEBUG_CONFIG: "remote_host=${DOCKER_LOCAL_IP} idekey=xdebug"
    depends_on:
      - "mysql"
    networks:
      - "front"
      - "back"
    volumes:
      - "../plugin-folder:/var/www/html/wp-content/plugins/plugin-folder"
  mysql:
    image: "mariadb:10.2"
    environment:
      MYSQL_ALLOW_EMPTY_PASSWORD: "yes"
      MYSQL_DATABASE: "wordpress"
      MYSQL_ROOT_PASSWORD: ""
    networks:
      - "back"
  proxy:
    image: "jwilder/nginx-proxy:alpine"
    ports:
      - "80:80"
    networks:
      front:
        aliases:
          - "${DOCKER_DEV_DOMAIN}"
    volumes:
      - "/var/run/docker.sock:/tmp/docker.sock:ro"

networks:
  front: {}
  back: {}

This is my .env file:

DOCKER_DEV_DOMAIN=project.test
DOCKER_LOCAL_IP=192.168.1.73

These are the logs of the proxy container: image

These are the logs of the wordpress container: image

chriszarate commented 6 years ago

You must access your site via the host configured in your .env file (project.test) in your case. You must also add a corresponding entry in your /etc/hosts file (step 3 of README).

Richi2293 commented 6 years ago

Yes, now it works. I just had to go to http://project.test instead of localhost. Thanks