{"action":"created","issue":{"url":"https://api.github.com/repos/docker-library/wordpress/issues/84","repository_url":"https://api.github.com/repos/docker-library/wordpress","labels_url":"https://api.github.com/repos/docker-library/wordpress/issues/84/labels{/name}","comments_url":"https://api.github.com/repos/docker-library/wordpress/issues/84/comments","events_url":"https://api.github.com/repos/docker-library/wordpress/issues/84/events","html_url":"https://github.com/docker-library/wordpress/issues/84","id":91191774,"number":84,"title":"Mapping /var/www/html to existing wp folder","user":{"login":"tubia","id":5247744,"avatar_url":"https://avatars.githubusercontent.com/u/5247744?v=3","gravatar_id":"","url":"https://api.github.com/users/tubia","html_url":"https://github.com/tubia","followers_url":"https://api.github.com/users/tubia/followers","following_url":"https://api.github.com/users/tubia/following{/other_user}","gists_url":"https://api.github.com/users/tubia/gists{/gist_id}","starred_url":"https://api.github.com/users/tubia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tubia/subscriptions","organizations_url":"https://api.github.com/users/tubia/orgs","repos_url":"https://api.github.com/users/tubia/repos","events_url":"https://api.github.com/users/tubia/events{/privacy}","received_events_url":"https://api.github.com/users/tubia/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":10,"created_at":"2015-06-26T08:43:14Z","updated_at":"2016-07-12T18:15:36Z","closed_at":null,"body":"Hi all,  \r\nI created a docker-compose file to make the images work taking an existing wordpress folder that is on my home.  \r\nHere is the docker-compose.yml\r\n```yaml\r\nwordpress:\r\n  image: wordpress\r\n  links:\r\n    - db:mysql\r\n  ports:\r\n    - 8082:80\r\n  environment:\r\n    WORDPRESS_DB_USER: test\r\n    WORDPRESS_DB_PASSWORD: test\r\n    WORDPRESS_DB_NAME: test\r\n  volumes:\r\n     - /home/tubia/test/:/var/www/html\r\n\r\ndb:\r\n  image: mysql\r\n  environment:\r\n    MYSQL_ROOT_PASSWORD: example\r\n    MYSQL_DATABASE: test\r\n    MYSQL_USER: test\r\n    MYSQL_PASSWORD: test\r\n```\r\nThis results in the installation page, when I visit `localhost:8082`, so it is not taking the volume as configured. Also If I enter the container with `docker exec -ti wp_container /bin/bash` and `ls` the `/var/www/html`, it's a standard default wp installation, not the one I mapped with the volume.\r\n\r\nHints? It is the expected behaviour?"},"comment":{"url":"https://api.github.com/repos/docker-library/wordpress/issues/comments/232132635","html_url":"https://github.com/docker-library/wordpress/issues/84#issuecomment-232132635","issue_url":"https://api.github.com/repos/docker-library/wordpress/issues/84","id":232132635,"user":{"login":"bfreeds","id":5316367,"avatar_url":"https://avatars.githubusercontent.com/u/5316367?v=3","gravatar_id":"","url":"https://api.github.com/users/bfreeds","html_url":"https://github.com/bfreeds","followers_url":"https://api.github.com/users/bfreeds/followers","following_url":"https://api.github.com/users/bfreeds/following{/other_user}","gists_url":"https://api.github.com/users/bfreeds/gists{/gist_id}","starred_url":"https://api.github.com/users/bfreeds/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bfreeds/subscriptions","organizations_url":"https://api.github.com/users/bfreeds/orgs","repos_url":"https://api.github.com/users/bfreeds/repos","events_url":"https://api.github.com/users/bfreeds/events{/privacy}","received_events_url":"https://api.github.com/users/bfreeds/received_events","type":"User","site_admin":false},"created_at":"2016-07-12T18:15:36Z","updated_at":"2016-07-12T18:15:36Z","body":"Hi all, \r\n\r\nI'm experiencing a similar issue here, regarding the mounted volume still bringing me to a fresh install page.  Here are my details - please let me know if there's other info that would help replicate / understand what's going on here.\r\n\r\nMy directory structure:  \r\n- docker-compose.yml\r\n- **wordpress** (complete backup of WP-Engine install)  \r\n  - ...\r\n  - index.php\r\n  - wp-config.php (has info to connect to ./wp-content/mysql.sql dump)\r\n  - ...\r\n  - **wp-admin**\r\n  - **wp-content**\r\n    - mysql.sql\r\n    - ...\r\n  - **wp-includes**\r\n    - version.php\r\n    - ...\r\n\r\ndocker-compose.yml looks like this:\r\n```dockerfile\r\nversion: '2'  \r\nservices:  \r\n  db:  \r\n    image: mysql:5.7\r\n    #  this will load existing database into mysql container on startup\r\n    volumes:\r\n      - ./wordpress/wp-content/test_db.sql:/docker-entrypoint-initdb.d/test_db.sql\r\n    environment:  \r\n      MYSQL_DATABASE: [existing db name]\r\n      MYSQL_ROOT_PASSWORD: test\r\n    container_name: mysql\r\n    restart: always\r\n  wordpress:   \r\n    depends_on:\r\n      - db\r\n    image: wordpress:latest\r\n    volumes:\r\n      #  mount the wordpress install into container\r\n      - ./wordpress:/var/www/html\r\n    environment:\r\n      #  get a message that this is required for connecting to mysql, but it seems to overwrite wp-config.php\r\n      WORDPRESS_DB_PASSWORD: test\r\n    container_name: wordpress\r\n    ports: \r\n      - 8080:80\r\n    links:\r\n      - db\r\n    \r\n```\r\n\r\nMy understanding (from [this](https://forums.docker.com/t/how-to-port-an-existing-wordpress-site-to-a-docker-container/4860) discussion) is that when the \"wordpress\" container initializes and sees that wordpress is included in the container's /var/www/html the container's initialization script should not use environment variables to connect to the database.\r\n\r\nThe issue I'm having is that the wordpress container does not locate the database that has been initialized in the Mysql container.  What then happens is every time I go to localhost:8080 I'm presented with the dialogue for installing a fresh install of Wordpress.  \r\n\r\nI'm also noticing in the `wordpress/wp-config.php`, after `docker-compose up` these fields get overwritten from the existing exported settings to this:  \r\n```php\r\ndefine( 'DB_NAME', 'wordpress');\r\ndefine( 'DB_USER', 'root');\r\ndefine( 'DB_PASSWORD', 'test');\r\ndefine( 'DB_HOST', 'mysql');\r\n```\r\n\r\nThanks all in advance for helping figure this out - and the work being done on the official image.  After I finally can get this working I'd be happy to submit a pull request with documentation for replicating an existing site through Docker (I've found this aspect here and on the mysql import process to be a little scattered)."}}
{"actor":{"display_login":"bfreeds"}}