Esse repositório está customizado com certas novas funcionalidades, abaixo deste texto tem o texto original em Inglês.
-
Faça o clone deste repositório
-
Adicione
xpinc-eventos.test
to your/etc/hosts
file (Help link) -
Crie um arquivo .env na raiz e adicione o que vem a seguir, caso precise altere a por e crie um proxy para a porta 80:
DOCKER_DEV_DOMAIN=xpinc-eventos.test
LOCAL_PORT=80
LOCAL_SSL_PORT=443
-
Rode o
./setup.sh
-
Rode o
docker-compose up -d
-
Para iniciar instale o wordpress visitando o https://xpinc-eventos.test e siga os passos. A media que o site for crescendo vamos fazer backups da base de dados e compartilhar.
O Repositório do wp-vip-go é clonado ao rodar o script ./update.sh
. Dentro dele estão as configurações para baixá-lo. Verifique se o protocolo do github corresponde ao protocolo do seu acesso. Caso contrário irá falar.
Depois de clonado (Está a usar o develop como base), você pode trocar e criar o seu próprio branch:
cd src/wp
git checkout -b [branch name]
Daqui (src/wp) você pode mandar as alterações para o repositório do Wordpress VIP usando o git. Não use o git da raíz deste projeto, a não ser por uma causa bem nobre, exemplo: Subir backup da base de dados.
Duvidas é só falar comigo rogers.sampaio@vitaminaweb.com.br
This repo provides a Docker-based environment for WordPress VIP Go development. It provides WordPress, MariaDB, Memcached, WP-CLI, and PHPUnit. It further adds VIP Go mu-plugins and a Photon server to closely mimic a VIP Go environment.
For an environment suitable for "classic" VIP development, check out my docker-wordpress-vip repo.
If you only need a Docker WordPress development environment for a single plugin or theme, my docker-compose-wordpress repo is a simpler place to start.
-
Clone or fork this repo.
-
Add
xpinc-eventos.test
to your/etc/hosts
file:127.0.0.1 localhost xpinc-eventos.test
-
Edit
update.sh
to provide your VIP Go repo in thewp_repo
variable. -
Run
./setup.sh
. -
Run
docker-compose up -d
.
docker-compose run --rm wp-cli install-wp
Log in to http://xpinc-eventos.test/wp-admin/
with wordpress
/ wordpress
.
Alternatively, you can navigate to http://xpinc-eventos.test/
and manually perform
the famous five-second install.
You will probably want to create a shell alias for this:
docker-compose run --rm wp-cli wp [command]
The testing environment is provided by a separate Docker Compose file
(docker-compose.phpunit.yml
) to ensure isolation. To use it, you must first
start it, then manually run your test installation script. These are example
commands and will vary based on your test scaffold.
Note that, in the PHPUnit container, your code is mapped to /app
.
docker-compose -f docker-compose.yml -f docker-compose.phpunit.yml up -d
docker-compose -f docker-compose.phpunit.yml run --rm wordpress_phpunit /app/bin/install-wp-tests.sh
Now you are ready to run PHPUnit. Repeat this command as necessary:
docker-compose -f docker-compose.phpunit.yml run --rm wordpress_phpunit phpunit
Put project-specific WordPress config in conf/wp-local-config.php
and PHP ini
changes in conf/php-local.ini
, which are synced to the container. PHP ini
changes are only reflected when the container restarts. You may also adjust the
Nginx config of the reverse proxy container via conf/nginx-proxy.conf
.
A Photon server is included and enabled by default to more closely
mimic the WordPress VIP production environment. Requests to /wp-content/uploads
will be proxied to the Photon container—simply append Photon-compatible query
string parameters to the URL.
A Memcached server and object-cache.php
drop-in are available via the separate
docker-compose.memcached.yml
but are not enabled by default. To use it, either
manually merge it into the main docker-compose.yml
or reference it explicitly
when interacting with the stack:
docker-compose -f docker-compose.yml -f docker-compose.memcached.yml up -d
This repo provide HTTPS support out of the box. The setup script generates
self-signed certificates for the domain specified in .env
. To enforce the use
of HTTPS, comment out (or remove) HTTPS_METHOD: "nohttps"
from the
services/proxy/environment
section of docker-compose.yml
.
You may wish to add the generated root certificate to your system’s trusted root certificates. This will allow you to browse your dev environment over HTTPS without accepting a browser security warning. On OS X:
sudo security add-trusted-cert -d -r trustRoot -k /Library/Keychains/System.keychain certs/ca-root/ca.crt
Multiple instances of this dev environment are possible. Make an additional copy
of this repo with a different folder name. Then, either juggle them by stopping
one and starting another, or modify /etc/hosts
and .env
to use another
domain, e.g., project2.test
.
If your stack is not responding, the most likely cause is that a container has stopped or failed to start. Check to see if all of the containers are "Up":
docker-compose ps
If not, inspect the logs for that container, e.g.:
docker-compose logs wordpress
Running update.sh
again can also help resolve problems.
If your self-signed certs have expired (ERR_CERT_DATE_INVALID
), simply delete
the certs/self-signed
directory, run ./certs/create-certs.sh
, and restart
the stack.