visiblevc / wordpress-starter

A slightly less shitty wordpress development workflow
687 stars 167 forks source link

Running docker on windows 10 using docker-machine #63

Open miguelangeltorresfp opened 7 years ago

miguelangeltorresfp commented 7 years ago

Hi, this is a great project and I think it's just what I was looking for.

I run docker-compose up but then when I visit http://192.168.99.100:8080/ there are a lot of resources that fail to load from http://localhost:8080/.

Any help be appreciated. Thanks in advance.

dsifford commented 7 years ago

@miguelangeltorresfp Can you please share your compose file?

miguelangeltorresfp commented 7 years ago

Sure @dsifford, but I didn't modify anything.

version: '2' services: wordpress: image: visiblevc/wordpress:latest ports:

I was just following this tutorial https://visible.vc/engineering/docker-environment-for-wordpress/

I just did git clone https://github.com/visiblevc/wordpress-starter the-project cd the-project docker-compose up

dsifford commented 7 years ago

@miguelangeltorresfp Which resources are failing to load? Can you rebuild with VERBOSE: 'true' set and paste your logs?

Thanks

karellm commented 7 years ago

@miguelangeltorresfp I don't know how it works on Windows but you should probably forward the 8080 port from Docker (or the VM that runs it). That way you should be able to access the entire site via localhost, not the VM IP address.

UPDATE: The VM IP can change, that's why it is not a good idea to use it. It would require you to change it throughout your wordpress DB for the site to work.

miguelangeltorresfp commented 7 years ago

These are the resources that are failing

(index):35 GET http://localhost:8080/wp-content/themes/twentyseventeen/style.css?ver=4.7 net::ERR_CONNECTION_REFUSED
(index):42 GET http://localhost:8080/wp-includes/js/jquery/jquery.js?ver=1.12.4 net::ERR_CONNECTION_REFUSED
(index):43 GET http://localhost:8080/wp-includes/js/jquery/jquery-migrate.min.js?ver=1.4.1 net::ERR_CONNECTION_REFUSED
(index):158 GET http://localhost:8080/wp-content/themes/twentyseventeen/assets/js/skip-link-focus-fix.js?ver=1.0 net::ERR_CONNECTION_REFUSED
(index):159 GET http://localhost:8080/wp-content/themes/twentyseventeen/assets/js/global.js?ver=1.0 net::ERR_CONNECTION_REFUSED
(index):160 GET http://localhost:8080/wp-content/themes/twentyseventeen/assets/js/jquery.scrollTo.js?ver=2.1.2 net::ERR_CONNECTION_REFUSED
(index):161 GET http://localhost:8080/wp-includes/js/wp-embed.min.js?ver=4.7 net::ERR_CONNECTION_REFUSED
(index):60 GET http://localhost:8080/wp-content/themes/twentyseventeen/assets/images/header.jpg net::ERR_CONNECTION_REFUSED
(index):18 GET http://localhost:8080/wp-includes/js/wp-emoji-release.min.js?ver=4.7 net::ERR_CONNECTION_REFUSED

Sorry @dsifford, I'm a newbie and I'm not sure where I have to add VERBOSE: 'true'

I run docker-compose --verbose up

$ docker-compose --verbose up

compose.config.config.find: Using configuration files: .\docker-compose.yml
docker.auth.auth.find_config_file: Trying paths: ['C:\\Users\\Pc\\.docker\\confi                                  g.json', 'C:\\Users\\Pc\\.dockercfg']
docker.auth.auth.find_config_file: No config file found
compose.cli.command.get_client: docker-compose version 1.8.1, build 004ddae
docker-py version: 1.10.3
CPython version: 2.7.12
OpenSSL version: OpenSSL 1.0.2h  3 May 2016
compose.cli.command.get_client: Docker base_url: https://192.168.99.100:2376
compose.cli.command.get_client: Docker version: KernelVersion=4.4.27-boot2docker                                  , Os=linux, BuildTime=2016-10-26T23:26:11.105168198+00:00, ApiVersion=1.24, Vers                                  ion=1.12.3, GitCommit=6b644ec, Arch=amd64, GoVersion=go1.6.3
compose.cli.verbose_proxy.proxy_callable: docker info <- ()
compose.cli.verbose_proxy.proxy_callable: docker info -> {u'Architecture': u'x86                                  _64',
 u'BridgeNfIp6tables': True,
 u'BridgeNfIptables': True,
 u'CPUSet': True,
 u'CPUShares': True,
 u'CgroupDriver': u'cgroupfs',
 u'ClusterAdvertise': u'',
 u'ClusterStore': u'',
 u'Containers': 2,
 u'ContainersPaused': 0,
...
compose.cli.verbose_proxy.proxy_callable: docker inspect_network <- (u'theprojec                                  t_default')
compose.cli.verbose_proxy.proxy_callable: docker inspect_network -> {u'Container                                  s': {},
 u'Driver': u'bridge',
 u'EnableIPv6': False,
 u'IPAM': {u'Config': [{u'Gateway': u'172.20.0.1/16',
                        u'Subnet': u'172.20.0.0/16'}],
           u'Driver': u'default',
           u'Options': None},
 u'Id': u'b31276f816a0485baefa22e11fa01e0a3dc25452e8cac45f35c5d431ec59db6f',
 u'Internal': False,
 u'Labels': {},
...
compose.cli.verbose_proxy.proxy_callable: docker inspect_volume <- (u'theproject                                  _data')
compose.cli.verbose_proxy.proxy_callable: docker inspect_volume -> {u'Driver': u                                  'local',
 u'Labels': None,
 u'Mountpoint': u'/mnt/sda1/var/lib/docker/volumes/theproject_data/_data',
 u'Name': u'theproject_data',
 u'Scope': u'local'}
compose.cli.verbose_proxy.proxy_callable: docker inspect_volume <- (u'theproject                                  _data')
compose.cli.verbose_proxy.proxy_callable: docker inspect_volume -> {u'Driver': u                                  'local',
 u'Labels': None,
 u'Mountpoint': u'/mnt/sda1/var/lib/docker/volumes/theproject_data/_data',
 u'Name': u'theproject_data',
 u'Scope': u'local'}
compose.cli.verbose_proxy.proxy_callable: docker containers <- (all=False, filte                                  rs={u'label': [u'com.docker.compose.project=theproject', u'com.docker.compose.on                                  eoff=False']})
compose.cli.verbose_proxy.proxy_callable: docker containers -> (list with 0 item                                  s)
compose.cli.verbose_proxy.proxy_callable: docker containers <- (all=True, filter                                  s={u'label': [u'com.docker.compose.project=theproject', u'com.docker.compose.ser                                  vice=db', u'com.docker.compose.oneoff=False']})
compose.cli.verbose_proxy.proxy_callable: docker containers -> (list with 1 item                                  s)
compose.cli.verbose_proxy.proxy_callable: docker inspect_container <- (u'c1379de                                  a58ffa23d19d6ea9c929b9616b2ef6b71959d0f461a1f808660653965')
compose.cli.verbose_proxy.proxy_callable: docker inspect_container -> {u'AppArmo                                  rProfile': u'',
 u'Args': [u'mysqld'],
 u'Config': {u'AttachStderr': False,
             u'AttachStdin': False,
             u'AttachStdout': False,
             u'Cmd': [u'mysqld'],
             u'Domainname': u'',
             u'Entrypoint': [u'docker-entrypoint.sh'],
             u'Env': [u'MYSQL_ROOT_PASSWORD=root',
                      u'PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/                                  sbin:/bin',
...
compose.cli.verbose_proxy.proxy_callable: docker containers <- (all=True, filter                                  s={u'label': [u'com.docker.compose.project=theproject', u'com.docker.compose.ser                                  vice=wordpress', u'com.docker.compose.oneoff=False']})
compose.cli.verbose_proxy.proxy_callable: docker containers -> (list with 1 item                                  s)
compose.cli.verbose_proxy.proxy_callable: docker inspect_container <- (u'6fa6721                                  6e4b4551c482b8303f98f2014969b3aab357f8f45e070ed34c720172a')
compose.cli.verbose_proxy.proxy_callable: docker inspect_container -> {u'AppArmo                                  rProfile': u'',
 u'Args': [],
 u'Config': {u'AttachStderr': False,
             u'AttachStdin': False,
             u'AttachStdout': False,
             u'Cmd': [u'/run.sh'],
             u'Domainname': u'',
             u'Entrypoint': None,
             u'Env': [u'DB_PASS=root',
                      u'DB_NAME=wordpress',
...
compose.cli.verbose_proxy.proxy_callable: docker inspect_image <- ('mariadb:10')
compose.cli.verbose_proxy.proxy_callable: docker inspect_image -> {u'Architectur                                  e': u'amd64',
 u'Author': u'',
 u'Comment': u'',
 u'Config': {u'ArgsEscaped': True,
             u'AttachStderr': False,
             u'AttachStdin': False,
             u'AttachStdout': False,
             u'Cmd': [u'mysqld'],
             u'Domainname': u'',
             u'Entrypoint': [u'docker-entrypoint.sh'],
...
compose.cli.verbose_proxy.proxy_callable: docker inspect_image <- ('visiblevc/wo                                  rdpress:latest')
compose.cli.verbose_proxy.proxy_callable: docker inspect_image -> {u'Architectur                                  e': u'amd64',
 u'Author': u'Derek P Sifford <dereksifford@gmail.com>',
 u'Comment': u'',
 u'Config': {u'ArgsEscaped': True,
             u'AttachStderr': False,
             u'AttachStdin': False,
             u'AttachStdout': False,
             u'Cmd': [u'/run.sh'],
             u'Domainname': u'',
             u'Entrypoint': None,
...
compose.cli.verbose_proxy.proxy_callable: docker containers <- (all=True, filter                                  s={u'label': [u'com.docker.compose.project=theproject', u'com.docker.compose.ser                                  vice=db', u'com.docker.compose.oneoff=False']})
compose.cli.verbose_proxy.proxy_callable: docker containers -> (list with 1 item                                  s)
compose.cli.verbose_proxy.proxy_callable: docker inspect_image <- ('mariadb:10')
compose.cli.verbose_proxy.proxy_callable: docker inspect_image -> {u'Architectur                                  e': u'amd64',
 u'Author': u'',
 u'Comment': u'',
 u'Config': {u'ArgsEscaped': True,
             u'AttachStderr': False,
             u'AttachStdin': False,
             u'AttachStdout': False,
             u'Cmd': [u'mysqld'],
             u'Domainname': u'',
             u'Entrypoint': [u'docker-entrypoint.sh'],
...
compose.cli.verbose_proxy.proxy_callable: docker inspect_container <- (u'c1379de                                  a58ffa23d19d6ea9c929b9616b2ef6b71959d0f461a1f808660653965')
compose.cli.verbose_proxy.proxy_callable: docker inspect_container -> {u'AppArmo                                  rProfile': u'',
 u'Args': [u'mysqld'],
 u'Config': {u'AttachStderr': False,
             u'AttachStdin': False,
             u'AttachStdout': False,
             u'Cmd': [u'mysqld'],
             u'Domainname': u'',
             u'Entrypoint': [u'docker-entrypoint.sh'],
             u'Env': [u'MYSQL_ROOT_PASSWORD=root',
                      u'PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/                                  sbin:/bin',
...
compose.cli.verbose_proxy.proxy_callable: docker containers <- (all=True, filter                                  s={u'label': [u'com.docker.compose.project=theproject', u'com.docker.compose.ser                                  vice=wordpress', u'com.docker.compose.oneoff=False']})
compose.cli.verbose_proxy.proxy_callable: docker containers -> (list with 1 item                                  s)
compose.cli.verbose_proxy.proxy_callable: docker inspect_image <- ('visiblevc/wo                                  rdpress:latest')
compose.cli.verbose_proxy.proxy_callable: docker inspect_image -> {u'Architectur                                  e': u'amd64',
 u'Author': u'Derek P Sifford <dereksifford@gmail.com>',
 u'Comment': u'',
 u'Config': {u'ArgsEscaped': True,
             u'AttachStderr': False,
             u'AttachStdin': False,
             u'AttachStdout': False,
             u'Cmd': [u'/run.sh'],
             u'Domainname': u'',
             u'Entrypoint': None,
...
compose.cli.verbose_proxy.proxy_callable: docker inspect_container <- (u'6fa6721                                  6e4b4551c482b8303f98f2014969b3aab357f8f45e070ed34c720172a')
compose.cli.verbose_proxy.proxy_callable: docker inspect_container -> {u'AppArmo                                  rProfile': u'',
 u'Args': [],
 u'Config': {u'AttachStderr': False,
             u'AttachStdin': False,
             u'AttachStdout': False,
             u'Cmd': [u'/run.sh'],
             u'Domainname': u'',
             u'Entrypoint': None,
             u'Env': [u'DB_PASS=root',
                      u'DB_NAME=wordpress',
...
compose.parallel.feed_queue: Pending: set([<Service: db>, <Service: wordpress>])
compose.parallel.feed_queue: Starting producer thread for <Service: db>
compose.service.start_container_if_stopped: Starting theproject_db_1
compose.parallel.feed_queue: Starting producer thread for <Service: wordpress>
compose.cli.verbose_proxy.proxy_callable: docker attach <- (u'c1379dea58ffa23d19                                  d6ea9c929b9616b2ef6b71959d0f461a1f808660653965', stderr=True, stream=True, stdou                                  t=True)
compose.service.start_container_if_stopped: Starting theproject_wordpress_1
compose.cli.verbose_proxy.proxy_callable: docker attach <- (u'6fa67216e4b4551c48                                  2b8303f98f2014969b3aab357f8f45e070ed34c720172a', stderr=True, stream=True, stdou                                  t=True)
compose.cli.verbose_proxy.proxy_callable: docker attach -> <generator object fra                                  mes_iter at 0x0000000003F1ED80>
compose.cli.verbose_proxy.proxy_callable: docker start <- (u'c1379dea58ffa23d19d                                  6ea9c929b9616b2ef6b71959d0f461a1f808660653965')
compose.cli.verbose_proxy.proxy_callable: docker attach -> <generator object fra                                  mes_iter at 0x0000000003F1EEA0>
compose.cli.verbose_proxy.proxy_callable: docker start <- (u'6fa67216e4b4551c482                                  b8303f98f2014969b3aab357f8f45e070ed34c720172a')
compose.parallel.feed_queue: Pending: set([])
compose.parallel.feed_queue: Pending: set([])
compose.parallel.feed_queue: Pending: set([])
compose.cli.verbose_proxy.proxy_callable: docker start -> None
compose.parallel.parallel_execute_iter: Finished processing: <Service: db>
compose.parallel.feed_queue: Pending: set([])
compose.cli.verbose_proxy.proxy_callable: docker start -> None
compose.parallel.parallel_execute_iter: Finished processing: <Service: wordpress                                  >
compose.parallel.feed_queue: Pending: set([])
compose.cli.verbose_proxy.proxy_callable: docker events <- (decode=True, filters                                  ={u'label': [u'com.docker.compose.project=theproject', u'com.docker.compose.oneo                                  ff=False']})
Attaching to theproject_db_1, theproject_wordpress_1
wordpress_1  | =================================================================                                  ==============
wordpress_1  |                          Begin WordPress Installation
compose.cli.verbose_proxy.proxy_callable: docker events -> <generator object _st                                  ream_helper at 0x0000000003F4C090>
wordpress_1  | =================================================================                                  ==============
db_1         | 2016-12-11 18:23:40 139926380898240 [Note] mysqld (mysqld 10.1.19                                  -MariaDB-1~jessie) starting as process 1 ...
db_1         | 2016-12-11 18:23:41 139926380898240 [Note] InnoDB: Using mutexes                                   to ref count buffer pool pages
db_1         | 2016-12-11 18:23:41 139926380898240 [Note] InnoDB: The InnoDB mem                                  ory heap is disabled
db_1         | 2016-12-11 18:23:41 139926380898240 [Note] InnoDB: Mutexes and rw                                  _locks use GCC atomic builtins
db_1         | 2016-12-11 18:23:41 139926380898240 [Note] InnoDB: GCC builtin __                                  atomic_thread_fence() is used for memory barrier
db_1         | 2016-12-11 18:23:41 139926380898240 [Note] InnoDB: Compressed tab                                  les use zlib 1.2.8
db_1         | 2016-12-11 18:23:41 139926380898240 [Note] InnoDB: Using Linux na                                  tive AIO
db_1         | 2016-12-11 18:23:41 139926380898240 [Note] InnoDB: Using SSE crc3                                  2 instructions
db_1         | 2016-12-11 18:23:41 139926380898240 [Note] InnoDB: Initializing b                                  uffer pool, size = 256.0M
db_1         | 2016-12-11 18:23:41 139926380898240 [Note] InnoDB: Completed init                                  ialization of buffer pool
db_1         | 2016-12-11 18:23:41 139926380898240 [Note] InnoDB: Highest suppor                                  ted file format is Barracuda.
db_1         | 2016-12-11 18:23:41 139926380898240 [Note] InnoDB: 128 rollback s                                  egment(s) are active.
db_1         | 2016-12-11 18:23:41 139926380898240 [Note] InnoDB: Waiting for pu                                  rge to start
db_1         | 2016-12-11 18:23:41 139926380898240 [Note] InnoDB:  Percona XtraD                                  B (http://www.percona.com) 5.6.32-79.0 started; log sequence number 2439806
db_1         | 2016-12-11 18:23:41 139926380898240 [Note] Plugin 'FEEDBACK' is d                                  isabled.
db_1         | 2016-12-11 18:23:41 139925605287680 [Note] InnoDB: Dumping buffer                                   pool(s) not yet started
db_1         | 2016-12-11 18:23:41 139926380898240 [Note] Server socket created                                   on IP: '::'.
db_1         | 2016-12-11 18:23:41 139926380898240 [Warning] 'proxies_priv' entr                                  y '@% root@c1379dea58ff' ignored in --skip-name-resolve mode.
wordpress_1  | ==> Waiting for MySQL to initialize...
wordpress_1  |   ->  mysqld is alive
wordpress_1  | ==> Configuring WordPress
wordpress_1  |   -> Generating wp-config.php file... ✓
wordpress_1  | ==> Checking database
wordpress_1  |   -> Database exists. SKIPPING...
wordpress_1  | ==> Checking for multisite
wordpress_1  |   -> Multisite not found. SKIPPING...
wordpress_1  | ==> Checking themes
wordpress_1  |   -> No theme dependencies listed
wordpress_1  | ==> Checking for orphaned themes
wordpress_1  |   -> 'twentyseventeen' no longer needed. Pruning Error: No themes                                   deleted.
wordpress_1  | ✘
wordpress_1  | ==> Checking plugins
wordpress_1  |   -> No plugin dependencies listed
wordpress_1  | ==> Checking for orphaned plugins
wordpress_1  |   -> '' no longer needed. Pruning... ✓
wordpress_1  | ==> Finalizing
wordpress_1  |   -> .htaccess exists. SKIPPING...
wordpress_1  |   -> Adjusting file permissions ✓
wordpress_1  | =================================================================                                  ==============
wordpress_1  |                        WordPress Configuration Complete!
wordpress_1  | =================================================================                                  ==============
wordpress_1  | [Sun Dec 11 18:23:46.282408 2016] [mpm_prefork:notice] [pid 1] AH00163: Apache/2.4.10 (Debian) PHP/7.0.13 configured -- resuming normal operations
wordpress_1  | [Sun Dec 11 18:23:46.282772 2016] [core:notice] [pid 1] AH00094: Command line: 'apache2 -D FOREGROUND'
dsifford commented 7 years ago

@miguelangeltorresfp Three things...

  1. Isn't windows supported natively by docker now using their built-in ubuntu subsystem?
  2. Just to confirm, the IP address 192.168.99.100 was the output of docker-machine ip <your-machine-name>?
  3. Can you completely rebuild using the configuration below?
version: '2'
services:
  wordpress:
    image: visiblevc/wordpress:latest
    ports:
      - 8080:80
      - 443:443
    environment:
      DB_NAME: wordpress
      DB_PASS: root
  db:
    image: mariadb:10
    volumes:
      - data:/var/lib/mysql
    environment:
      MYSQL_ROOT_PASSWORD: root
volumes:
  data:

Make sure that you run the following commands prior do rebuilding.

docker-compose down -v

Kill and remove all containers that may be running

docker rm $(docker ps -aq)

and if the output of docker volume ls isn't empty, run this...

docker volume rm $(docker volume ls -q)

Remove all build images so that you know for sure that you have the latest one..

docker rmi $(docker images -q)
miguelangeltorresfp commented 7 years ago

Thank you @karellm and @dsifford for your time and patience.

1 ) I have windows home edition and It's not supported yet.

2 ) Yes, the ip of the default docker-machine is 192.168.99.100

$ docker-machine ls
NAME      ACTIVE   DRIVER       STATE     URL                         SWARM   DOCKER    ERRORS
default   *        virtualbox   Running   tcp://192.168.99.100:2376           v1.12.3

3 ) I had already did all of these steps before. And I've done them again. The result is the same. I can't enter to the admin dashboard neither. http://192.168.99.100:8080/wp-admin is redirected to http://localhost:8080/wp-login.php?redirect_to=http%3A%2F%2F192.168.99.100%3A8080%2Fwp-admin%2F&reauth=1

I've tested the official quickstart project for wordpress and it works without problems. https://docs.docker.com/compose/wordpress/ But I think the main difference is that I have to install wordpress the first time I visit the site.

dsifford commented 7 years ago

@miguelangeltorresfp Is the URL that is shown using docker-machine ls the same as a the IP address that is printed using docker-machine ip default? Just want to make sure we're covering all bases here.

I run on linux mainly (sometimes OSX) so unfortunately I can't attempt to recreate your issue since I have no access to a windows machine.

miguelangeltorresfp commented 7 years ago
$ docker-machine ip default
192.168.99.100

@dsifford, yes, now I know that working on windows for web development is not the most advisable. I didn't know that until I start to test Varying-Vagrant-Vagrants-vvv.

dsifford commented 7 years ago

@miguelangeltorresfp Let me see if I can recreate this issue with docker-machine on a cloud provider. Busy with other things at the moment, but I should be able to try in the next couple of days.

miguelangeltorresfp commented 7 years ago

@dsifford Thank you very much for your help.

And don't worry, take your time, I'll be checking this thread for a possible solution.

miguelangeltorresfp commented 7 years ago

@dsifford, @karellm

I've been following this tutorial. https://www.sitepoint.com/how-to-manually-build-docker-containers-for-wordpress/

It works with two containers 1 ) From an image built from this dockerfile

FROM php:5.6-apache
MAINTAINER ....
RUN docker-php-ext-install mysqli
CMD ["apache2-foreground"]

2 ) Built with this command docker run --name wordpressdb -e MYSQL_ROOT_PASSWORD=password -e MYSQL_DATABASE=wordpress -d mysql

The wordpress files have been copied into the working directory of the apache container.

I visit the site, install wordpress and then, when I get into the wordpress admin dashboard, in general settings, it shows

WordPress Address(URL) http://192.168.99.100
Site Address (URL) http://192.168.99.100

I think this is what is causing problems. I have to access wordpress from outside the docker-machine using the VM IP.

dsifford commented 7 years ago

@miguelangeltorresfp Do you have access to the container now? Can you open a shell session in the wordpress container and show me the output of the following two commands.

wp option get siteurl --allow-root
wp option get home --allow-root

And also, as a reminder, can you also give me the IP of your machine?

From outside the containers

docker-machine ip default

Got a hunch here about something.. Thanks.

miguelangeltorresfp commented 7 years ago

Sorry @dsifford if I'm a bit late with this, I'm from Spain.

$ docker exec -it theproject_wordpress_1 /bin/sh
# wp option get siteurl --allow-root
http://localhost:8080
# wp option get home --allow-root
http://localhost:8080
$ docker-machine ip
192.168.99.100
dsifford commented 7 years ago

No worries.

I think we have a winner!

Just to confirm, can you now run the following two commands in your wordpress service and see if it fixes your issue?

wp option set siteurl 192.168.99.100:8080 --allow-root
wp option set home 192.168.99.100:8080 --allow-root

Let me know. Thanks

miguelangeltorresfp commented 7 years ago

Sorry @dsifford, it doesn't seem to work neither.

I try setting the url with and without ports

# wp option set siteurl http://192.168.99.100 --allow-root
Success: Updated 'siteurl' option.
# wp option set home http://192.168.99.100 --allow-root
Success: Updated 'home' option.
# wp option set siteurl http://192.168.99.100:8080 --allow-root
Success: Updated 'siteurl' option.
# wp option set home http://192.168.99.100:8080 --allow-root
Success: Updated 'home' option.
# wp option get siteurl --allow-root
http://192.168.99.100:8080
# wp option get home --allow-root
http://192.168.99.100:8080

But when I try to access the site on the browser it refuses the connection.

And http://192.168.99.100:8080/ redirects to http://192.168.99.100/

dsifford commented 7 years ago

Sorry, you'll also have to flush your rewrite rules I think..

So after setting, run wp rewrite flush --hard --allow-root

miguelangeltorresfp commented 7 years ago

No, it's redirecting in the same way.

Maybe I have to replace old url with the new ones like in this article https://imagewize.com/changing-site-url-with-wp-cli/

But I don't know exactly how I must write it down, maybe like this ? wp search-replace 'http://localhost:8080' 'http://192.168.99.100:8080' --skip-columns=guid

dsifford commented 7 years ago

That's what SEARCH_REPLACE does in the wordpress service. I assume you've already tried that and it failed, correct?

miguelangeltorresfp commented 7 years ago

Yes, the server refuses the connection.

 wp search-replace 'http://localhost:8080' 'http://192.168.99.100:8080' --skip-columns=guid --allow-root
tput: No value for $TERM and no -T specified
+------------------+-----------------------+--------------+------+
| Table            | Column                | Replacements | Type |
+------------------+-----------------------+--------------+------+
| wp_commentmeta   | meta_key              | 0            | SQL  |
| wp_commentmeta   | meta_value            | 0            | SQL  |
| wp_comments      | comment_author        | 0            | SQL  |
| wp_comments      | comment_author_email  | 0            | SQL  |
| wp_comments      | comment_author_url    | 0            | SQL  |
| wp_comments      | comment_author_IP     | 0            | SQL  |
| wp_comments      | comment_content       | 0            | SQL  |
| wp_comments      | comment_approved      | 0            | SQL  |
| wp_comments      | comment_agent         | 0            | SQL  |
| wp_comments      | comment_type          | 0            | SQL  |
| wp_links         | link_url              | 0            | SQL  |
| wp_links         | link_name             | 0            | SQL  |
| wp_links         | link_image            | 0            | SQL  |
| wp_links         | link_target           | 0            | SQL  |
| wp_links         | link_description      | 0            | SQL  |
| wp_links         | link_visible          | 0            | SQL  |
| wp_links         | link_rel              | 0            | SQL  |
| wp_links         | link_notes            | 0            | SQL  |
| wp_links         | link_rss              | 0            | SQL  |
| wp_options       | option_name           | 0            | SQL  |
| wp_options       | option_value          | 0            | PHP  |
| wp_options       | autoload              | 0            | SQL  |
| wp_postmeta      | meta_key              | 0            | SQL  |
| wp_postmeta      | meta_value            | 0            | SQL  |
| wp_posts         | post_content          | 1            | SQL  |
| wp_posts         | post_title            | 0            | SQL  |
| wp_posts         | post_excerpt          | 0            | SQL  |
| wp_posts         | post_status           | 0            | SQL  |
| wp_posts         | comment_status        | 0            | SQL  |
| wp_posts         | ping_status           | 0            | SQL  |
| wp_posts         | post_password         | 0            | SQL  |
| wp_posts         | post_name             | 0            | SQL  |
| wp_posts         | to_ping               | 0            | SQL  |
| wp_posts         | pinged                | 0            | SQL  |
| wp_posts         | post_content_filtered | 0            | SQL  |
| wp_posts         | post_type             | 0            | SQL  |
| wp_posts         | post_mime_type        | 0            | SQL  |
| wp_term_taxonomy | taxonomy              | 0            | SQL  |
| wp_term_taxonomy | description           | 0            | SQL  |
| wp_termmeta      | meta_key              | 0            | SQL  |
| wp_termmeta      | meta_value            | 0            | SQL  |
| wp_terms         | name                  | 0            | SQL  |
| wp_terms         | slug                  | 0            | SQL  |
| wp_usermeta      | meta_key              | 0            | SQL  |
| wp_usermeta      | meta_value            | 0            | PHP  |
| wp_users         | user_login            | 0            | SQL  |
| wp_users         | user_nicename         | 0            | SQL  |
| wp_users         | user_email            | 0            | SQL  |
| wp_users         | user_url              | 0            | SQL  |
| wp_users         | user_activation_key   | 0            | SQL  |
| wp_users         | display_name          | 0            | SQL  |
+------------------+-----------------------+--------------+------+
Success: Made 1 replacements.
miguelangeltorresfp commented 7 years ago

But maybe I don't have to add the port to the url, do I ??

dsifford commented 7 years ago

See here: https://github.com/visiblevc/wordpress-starter#wordpress (SEARCH_REPLACE)

Destroy all your containers and rebuild trying that if you haven't done it already.

dsifford commented 7 years ago

I was under the assumption you already attempted that

miguelangeltorresfp commented 7 years ago

I tried

SEARCH_REPLACE: localhost:8080,192.168.99.100:8080

Then everything seems to have correctly installed, but the server is still refusing the connection.

$ docker exec -it theproject_wordpress_1 /bin/sh
# ls
index.php    wp-activate.php     wp-cli.yml            wp-config.php  wp-includes        wp-login.php     wp-signup.php
license.txt  wp-admin            wp-comments-post.php  wp-content     wp-links-opml.php  wp-mail.php      wp-trackback.php
readme.html  wp-blog-header.php  wp-config-sample.php  wp-cron.php    wp-load.php        wp-settings.php  xmlrpc.php
# cat wp-config.php
<?php
/**
 * The base configuration for WordPress
 *
 * The wp-config.php creation script uses this file during the
 * installation. You don't have to use the web site, you can
 * copy this file to "wp-config.php" and fill in the values.
 *
 * This file contains the following configurations:
 *
 * * MySQL settings
 * * Secret keys
 * * Database table prefix
 * * ABSPATH
 *
 * @link https://codex.wordpress.org/Editing_wp-config.php
 *
 * @package WordPress
 */

// ** MySQL settings ** //
/** The name of the database for WordPress */
define( 'DB_NAME', 'wordpress' );

/** MySQL database username */
define( 'DB_USER', 'root' );

/** MySQL database password */
define( 'DB_PASSWORD', 'root' );

/** MySQL hostname */
define( 'DB_HOST', 'db:3306' );

/** Database Charset to use in creating database tables. */
define( 'DB_CHARSET', 'utf8' );

/** The Database Collate type. Don't change this if in doubt. */
define( 'DB_COLLATE', '' );

/**
 * Authentication Unique Keys and Salts.
 *
 * Change these to different unique phrases!
 * You can generate these using the {@link https://api.wordpress.org/secret-key/1.1/salt/ WordPress.org secret-key service}
 * You can change these at any point in time to invalidate all existing cookies. This will force all users to have to log in again.
 *
 * @since 2.6.0
 */
define('AUTH_KEY',         'HX1:A3wzt|: Q7Q/-O+H^i[w791gR2LKJRMt#m)5hg!R~.G`$|QhW7+kY<-hUtq+');
define('SECURE_AUTH_KEY',  'g2EgBfteyT HLFOj1j~s>ZLbXaO/F*nCd_XM^4(BQ 5Vzxln]@ivXB}j= Go.}@I');
define('LOGGED_IN_KEY',    'gjJw?X)J+..8p,| !-RmJ)%ap8c!42il;%KQ 5!`;27Oy !3TGD<sF~k@6S_ts(N');
define('NONCE_KEY',        'jE#qr0td1Dc?VIDF2^Wn]+ovxB))[q{xAWBoAWn)B||/v.mH&c2/ko~RSP6rkp9s');
define('AUTH_SALT',        'tX $?;r3+f---sJGN@Nli&h:n:b^Ezh3AQD2e+7HbP>o&%)))-KO05b$,}G>@>:I');
define('SECURE_AUTH_SALT', '_.CaRR?G4^X?43{zA4 Kl{g!Mae|-HN#>pX0F@Yhih| $$2ZYLU~b4.i-_TUlzs~');
define('LOGGED_IN_SALT',   '{6j4=MOJ?&|W>p_6vMeFgESk1$wVuS.]#jAP@FV[,$vLdyR,zTn_1%AVH-37|EI5');
define('NONCE_SALT',       '0&Kjp^A!/OGM4ae#BETG8hE3C&j[6 H(fEb#`-T8k;NF)5Ilcc.c]Y+lie_r`N`}');

/**
 * WordPress Database Table prefix.
 *
 * You can have multiple installations in one database if you give each
 * a unique prefix. Only numbers, letters, and underscores please!
 */
$table_prefix = 'wp_';

define('WP_DEBUG', true);
define('WP_DEBUG_LOG', false);
define('WP_DEBUG_DISPLAY', true);

/* That's all, stop editing! Happy blogging. */

/** Absolute path to the WordPress directory. */
if ( ! defined( 'ABSPATH' ) )
        define( 'ABSPATH', dirname( __FILE__ ) . '/' );

/** Sets up WordPress vars and included files. */
require_once ABSPATH . 'wp-settings.php';
# exit

Pc@Pc-PC MINGW64 /d/docker-projects/visible-tutorial/the-project
$ docker exec -it theproject_wordpress_1 /bin/sh
# wp option get siteurl --allow-root
http://192.168.99.100:8080
# wp option get home --allow-root
http://192.168.99.100:8080

@dsifford , I don't want to want to bother you anymore with this.

It's better to wait for a more experienced windows user.

Thank you very much for your patience.