Crear docker-compose.yml y cambiar puerto de 8080 por 8081, 8082 para sucesivas instancias
version: '3.3'
services:
db:
image: mysql:5.7
volumes:
- '${PWD}/db_data:/var/lib/mysql'
restart: always
environment:
MYSQL_ROOT_PASSWORD: 12345678
MYSQL_DATABASE: wordpress
MYSQL_USER: wordpress
MYSQL_PASSWORD: wordpress
wordpress:
depends_on:
- db
image: wordpress:latest
ports:
- "8084:80"
restart: always
volumes:
- '${PWD}/wordpress:/var/www/html'
environment:
WORDPRESS_DB_HOST: db:3306
WORDPRESS_DB_USER: wordpress
WORDPRESS_DB_PASSWORD: wordpress
WORDPRESS_DB_NAME: wordpress
volumes:
db_data: {}
Para levantarlo:
docker-compose up -d
AƱadimos nginx:
server {
listen 80;
server_name gameofworks.lobo99.info;
location / {
proxy_pass http://192.168.1.200:8083;
proxy_buffering on;
proxy_buffers 12 12k;
proxy_redirect off;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header Host $host;
}
}
Copiamos el tema de Divi
docker cp /dades/web/Divi/. wwwgorkabartendercom_wordpress_1:/var/www/html/wp-content/themes/Divi/
====== BBDD ======
ruth@docker:~$ docker exec -ti gorkaperezcom_db_1 bash
root@1d78631f74d4:/# mysql -u wordpress -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 12337
Server version: 5.7.29 MySQL Community Server (GPL)
Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql>