Skip to content

Commit

Permalink
Merge pull request #180 from TransbankDevelopers/chore/add-docker-for…
Browse files Browse the repository at this point in the history
…-test

chore: add docker for test
  • Loading branch information
mvarlic authored Nov 23, 2023
2 parents e335622 + b65c8eb commit 1c2e448
Show file tree
Hide file tree
Showing 10 changed files with 380 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# Woocommerce Docker para desarrollo

### PHP 7.4 + Wordpress 6.0.0 + Wordpress Cli 6.0.0 + Mysql 5.7 + Woocommerce 6.0.0
### PHP 7.4 + Wordpress 6.0.0 + Wordpress Cli 2.6.0 + Mysql 5.7 + Woocommerce 6.0.0

### Requerimientos

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ x-common-variables: &common-variables
services:
db:
image: mysql:5.7
container_name: php7.4-wp6.0.0-wc6.0.0-woo6.0.0_mysql
container_name: php7.4-wp6.0.0-wc2.6.0-woo6.0.0_mysql
ports:
- "33060:3306"
volumes:
Expand All @@ -26,21 +26,20 @@ services:
depends_on:
- db
image: wordpress:6.0.0-php7.4-apache
container_name: php7.4-wp6.0.0-wc6.0.0-woo6.0.0_wordpress
container_name: php7.4-wp6.0.0-wc2.6.0-woo6.0.0_wordpress
ports:
- "8000:80"
restart: always
environment:
<<: *common-variables
volumes:
- ./wp_data:/var/www/html
- ./transbank-webpay-plus-rest:/var/www/html/wp-content/plugins/transbank-webpay-plus-rest
wordpress-cli:
depends_on:
- db
- wordpress
image: wordpress:cli-2.6.0-php7.4
container_name: php7.4-wp6.0.0-wc6.0.0-woo6.0.0_wordpress_cli
container_name: php7.4-wp6.0.0-wc2.6.0-woo6.0.0_wordpress_cli
# vstm: This is required to run wordpress-cli with the same
# user-id as wordpress. This way there are no permission problems
# when running the cli
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# Woocommerce Docker para desarrollo

### PHP 7.4 + Wordpress 6.0.0 + Wordpress Cli 6.0.0 + Mysql 5.7 + Woocommerce 6.5.0
### PHP 7.4 + Wordpress 6.0.0 + Wordpress Cli 2.6.0 + Mysql 5.7 + Woocommerce 6.5.0

### Requerimientos

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ x-common-variables: &common-variables
services:
db:
image: mysql:5.7
container_name: php7.4-wp6.0.0-wc6.0.0-woo6.5.0_mysql
container_name: php7.4-wp6.0.0-wc2.6.0-woo6.5.0_mysql
ports:
- "33060:3306"
volumes:
Expand All @@ -26,21 +26,20 @@ services:
depends_on:
- db
image: wordpress:6.0.0-php7.4-apache
container_name: php7.4-wp6.0.0-wc6.0.0-woo6.5.0_wordpress
container_name: php7.4-wp6.0.0-wc2.6.0-woo6.5.0_wordpress
ports:
- "8000:80"
restart: always
environment:
<<: *common-variables
volumes:
- ./wp_data:/var/www/html
- ./transbank-webpay-plus-rest:/var/www/html/wp-content/plugins/transbank-webpay-plus-rest
wordpress-cli:
depends_on:
- db
- wordpress
image: wordpress:cli-2.6.0-php7.4
container_name: php7.4-wp6.0.0-wc6.0.0-woo6.5.0_wordpress_cli
container_name: php7.4-wp6.0.0-wc2.6.0-woo6.5.0_wordpress_cli
# vstm: This is required to run wordpress-cli with the same
# user-id as wordpress. This way there are no permission problems
# when running the cli
Expand Down
44 changes: 44 additions & 0 deletions docker-woocommerce-php8.2-wp6.4.1-wc2.9.0-woo8.1.0/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
![Woocommerce](https://woocommerce.com/wp-content/themes/woo/images/[email protected])

# Woocommerce Docker para desarrollo

### PHP 8.2 + Wordpress 6.4.1 + Wordpress Cli 2.9.0 + Mysql 5.7 + Woocommerce 8.1.0

### Requerimientos

**MacOS:**

Instalar [Docker](https://docs.docker.com/docker-for-mac/install/), [Docker-compose](https://docs.docker.com/compose/install/#install-compose) y [Docker-sync](https://github.com/EugenMayer/docker-sync/wiki/docker-sync-on-OSX).

**Windows:**

Instalar [Docker](https://docs.docker.com/docker-for-windows/install/), [Docker-compose](https://docs.docker.com/compose/install/#install-compose) y [Docker-sync](https://github.com/EugenMayer/docker-sync/wiki/docker-sync-on-Windows).

**Linux:**

Instalar [Docker](https://docs.docker.com/engine/installation/linux/docker-ce/ubuntu/) y [Docker-compose](https://docs.docker.com/compose/install/#install-compose).

### Como usar

De forma automática se creará una imagen Wordpress y Wordpress Cli, se instalará WooCommerce con el tema Storefront y se creará un producto de ejemplo.

Para instalar Woocommerce, hacer lo siguiente y esperar 5 minutos:

```
docker compose up
```

Para Eliminar ejecutar y borrar las carpetas 'db_data' y 'wp_data':

```
docker compose down
```

### Paneles

**Web server:** http://localhost:8000

**Admin:** http://localhost:8000/wp-admin

user: admin
password: admin
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
version: '3.4'

x-common-variables: &common-variables
WORDPRESS_DB_HOST: db:3306
WORDPRESS_DB_USER: wordpress
WORDPRESS_DB_PASSWORD: wordpress
WORDPRESS_DB_NAME: wordpress
WORDPRESS_TABLE_PREFIX: "wp_"
WORDPRESS_DEBUG: 1

services:
db:
image: mysql:5.7
container_name: php8.2-wp6.4.1-wc2.9.0-woo8.1.0_mysql
ports:
- "33060:3306"
volumes:
- ./db_data:/var/lib/mysql
restart: always
environment:
MYSQL_ROOT_PASSWORD: wordpress
MYSQL_DATABASE: wordpress
MYSQL_USER: wordpress
MYSQL_PASSWORD: wordpress
wordpress:
depends_on:
- db
image: wordpress:6.4.1-php8.2-apache
container_name: php8.2-wp6.4.1-wc2.9.0-woo8.1.0_wordpress
ports:
- "8000:80"
restart: always
environment:
<<: *common-variables
volumes:
- ./wp_data:/var/www/html
wordpress-cli:
depends_on:
- db
- wordpress
image: wordpress:cli-2.9.0-php8.2
container_name: php8.2-wp6.4.1-wc2.9.0-woo8.1.0_wordpress_cli
# vstm: This is required to run wordpress-cli with the same
# user-id as wordpress. This way there are no permission problems
# when running the cli
user: "33:33"
environment:
<<: *common-variables
# vstm: The sleep 40 is required so that the command is run after
# mysql is initialized. Depending on your machine this might take
# longer or it can go faster.
command: >
/bin/sh -c '
sleep 40;
sed -i "s|# END WordPress|php_value upload_max_filesize 5000M \\n php_value post_max_size 5000M \\n php_value memory_limit 256M \\n php_value max_execution_time 300 \\n php_value max_input_time 300 \\n |g" /var/www/html/.htaccess;
wp core install --path="/var/www/html" --url="http://localhost:8000" --title="Transbank Store" --admin_user=admin --admin_password=admin [email protected];
wp --allow-root plugin install woocommerce --version=8.1.0 --activate;
wp --allow-root theme install storefront --activate;
wp --allow-root wc tool run install_pages --user=admin;
wp --allow-root wc product create --name="Zapatos deportivos" --sku=1 --regular_price=1000 --status=publish --user=admin;
wp --allow-root db query "UPDATE wp_options SET option_value=\"CLP\" WHERE option_name=\"woocommerce_currency\";";
wp --allow-root db query "UPDATE wp_options SET option_value=\"General Bustamante 24\" WHERE option_name=\"woocommerce_store_address\";";
wp --allow-root db query "UPDATE wp_options SET option_value=\"Of M, Piso 7\" WHERE option_name=\"woocommerce_store_address_2\";";
wp --allow-root db query "UPDATE wp_options SET option_value=\"Providencia\" WHERE option_name=\"woocommerce_store_city\";";
wp --allow-root db query "UPDATE wp_options SET option_value=\"CL\" WHERE option_name=\"woocommerce_default_country\";";
wp --allow-root db query "UPDATE wp_options SET option_value=\"7500000\" WHERE option_name=\"woocommerce_store_postcode\";";
wp --allow-root db query "UPDATE wp_options SET option_value=0 WHERE option_name=\"woocommerce_price_num_decimals\";";
wp --allow-root db query "UPDATE wp_options SET option_value=\".\" WHERE option_name=\"woocommerce_price_thousand_sep\";";
wp --allow-root db query "UPDATE wp_options SET option_value=\",\" WHERE option_name=\"woocommerce_price_decimal_sep\";";
wp --allow-root config set WP_DEBUG true;
wp --allow-root config set --add --type=constant WP_DEBUG_LOG true;
wp --allow-root config set --add --type=constant WP_DEBUG_DISPLAY false;
wp --allow-root config set --add --type=constant WPS_DEBUG true;
wp --allow-root config set --add --type=constant WPS_DEBUG_SCRIPTS true;
wp --allow-root config set --add --type=constant WPS_DEBUG_STYLES true;
'
volumes_from:
- wordpress
links:
- db
44 changes: 44 additions & 0 deletions docker-woocommerce-php8.2-wp6.4.1-wc2.9.0-woo8.2.0/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
![Woocommerce](https://woocommerce.com/wp-content/themes/woo/images/[email protected])

# Woocommerce Docker para desarrollo

### PHP 8.2 + Wordpress 6.4.1 + Wordpress Cli 2.9.0 + Mysql 5.7 + Woocommerce 8.2.0

### Requerimientos

**MacOS:**

Instalar [Docker](https://docs.docker.com/docker-for-mac/install/), [Docker-compose](https://docs.docker.com/compose/install/#install-compose) y [Docker-sync](https://github.com/EugenMayer/docker-sync/wiki/docker-sync-on-OSX).

**Windows:**

Instalar [Docker](https://docs.docker.com/docker-for-windows/install/), [Docker-compose](https://docs.docker.com/compose/install/#install-compose) y [Docker-sync](https://github.com/EugenMayer/docker-sync/wiki/docker-sync-on-Windows).

**Linux:**

Instalar [Docker](https://docs.docker.com/engine/installation/linux/docker-ce/ubuntu/) y [Docker-compose](https://docs.docker.com/compose/install/#install-compose).

### Como usar

De forma automática se creará una imagen Wordpress y Wordpress Cli, se instalará WooCommerce con el tema Storefront y se creará un producto de ejemplo.

Para instalar Woocommerce, hacer lo siguiente y esperar 5 minutos:

```
docker compose up
```

Para Eliminar ejecutar y borrar las carpetas 'db_data' y 'wp_data':

```
docker compose down
```

### Paneles

**Web server:** http://localhost:8000

**Admin:** http://localhost:8000/wp-admin

user: admin
password: admin
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
version: '3.4'

x-common-variables: &common-variables
WORDPRESS_DB_HOST: db:3306
WORDPRESS_DB_USER: wordpress
WORDPRESS_DB_PASSWORD: wordpress
WORDPRESS_DB_NAME: wordpress
WORDPRESS_TABLE_PREFIX: "wp_"
WORDPRESS_DEBUG: 1

services:
db:
image: mysql:5.7
container_name: php8.2-wp6.4.1-wc2.9.0-woo8.2.0_mysql
ports:
- "33060:3306"
volumes:
- ./db_data:/var/lib/mysql
restart: always
environment:
MYSQL_ROOT_PASSWORD: wordpress
MYSQL_DATABASE: wordpress
MYSQL_USER: wordpress
MYSQL_PASSWORD: wordpress
wordpress:
depends_on:
- db
image: wordpress:6.4.1-php8.2-apache
container_name: php8.2-wp6.4.1-wc2.9.0-woo8.2.0_wordpress
ports:
- "8000:80"
restart: always
environment:
<<: *common-variables
volumes:
- ./wp_data:/var/www/html
wordpress-cli:
depends_on:
- db
- wordpress
image: wordpress:cli-2.9.0-php8.2
container_name: php8.2-wp6.4.1-wc2.9.0-woo8.2.0_wordpress_cli
# vstm: This is required to run wordpress-cli with the same
# user-id as wordpress. This way there are no permission problems
# when running the cli
user: "33:33"
environment:
<<: *common-variables
# vstm: The sleep 40 is required so that the command is run after
# mysql is initialized. Depending on your machine this might take
# longer or it can go faster.
command: >
/bin/sh -c '
sleep 40;
sed -i "s|# END WordPress|php_value upload_max_filesize 5000M \\n php_value post_max_size 5000M \\n php_value memory_limit 256M \\n php_value max_execution_time 300 \\n php_value max_input_time 300 \\n |g" /var/www/html/.htaccess;
wp core install --path="/var/www/html" --url="http://localhost:8000" --title="Transbank Store" --admin_user=admin --admin_password=admin [email protected];
wp --allow-root plugin install woocommerce --version=8.2.0 --activate;
wp --allow-root theme install storefront --activate;
wp --allow-root wc tool run install_pages --user=admin;
wp --allow-root wc product create --name="Zapatos deportivos" --sku=1 --regular_price=1000 --status=publish --user=admin;
wp --allow-root db query "UPDATE wp_options SET option_value=\"CLP\" WHERE option_name=\"woocommerce_currency\";";
wp --allow-root db query "UPDATE wp_options SET option_value=\"General Bustamante 24\" WHERE option_name=\"woocommerce_store_address\";";
wp --allow-root db query "UPDATE wp_options SET option_value=\"Of M, Piso 7\" WHERE option_name=\"woocommerce_store_address_2\";";
wp --allow-root db query "UPDATE wp_options SET option_value=\"Providencia\" WHERE option_name=\"woocommerce_store_city\";";
wp --allow-root db query "UPDATE wp_options SET option_value=\"CL\" WHERE option_name=\"woocommerce_default_country\";";
wp --allow-root db query "UPDATE wp_options SET option_value=\"7500000\" WHERE option_name=\"woocommerce_store_postcode\";";
wp --allow-root db query "UPDATE wp_options SET option_value=0 WHERE option_name=\"woocommerce_price_num_decimals\";";
wp --allow-root db query "UPDATE wp_options SET option_value=\".\" WHERE option_name=\"woocommerce_price_thousand_sep\";";
wp --allow-root db query "UPDATE wp_options SET option_value=\",\" WHERE option_name=\"woocommerce_price_decimal_sep\";";
wp --allow-root config set WP_DEBUG true;
wp --allow-root config set --add --type=constant WP_DEBUG_LOG true;
wp --allow-root config set --add --type=constant WP_DEBUG_DISPLAY false;
wp --allow-root config set --add --type=constant WPS_DEBUG true;
wp --allow-root config set --add --type=constant WPS_DEBUG_SCRIPTS true;
wp --allow-root config set --add --type=constant WPS_DEBUG_STYLES true;
'
volumes_from:
- wordpress
links:
- db
44 changes: 44 additions & 0 deletions docker-woocommerce-php8.2-wp6.4.1-wc2.9.0-woo8.3.0/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
![Woocommerce](https://woocommerce.com/wp-content/themes/woo/images/[email protected])

# Woocommerce Docker para desarrollo

### PHP 8.2 + Wordpress 6.4.1 + Wordpress Cli 2.9.0 + Mysql 5.7 + Woocommerce 8.3.0

### Requerimientos

**MacOS:**

Instalar [Docker](https://docs.docker.com/docker-for-mac/install/), [Docker-compose](https://docs.docker.com/compose/install/#install-compose) y [Docker-sync](https://github.com/EugenMayer/docker-sync/wiki/docker-sync-on-OSX).

**Windows:**

Instalar [Docker](https://docs.docker.com/docker-for-windows/install/), [Docker-compose](https://docs.docker.com/compose/install/#install-compose) y [Docker-sync](https://github.com/EugenMayer/docker-sync/wiki/docker-sync-on-Windows).

**Linux:**

Instalar [Docker](https://docs.docker.com/engine/installation/linux/docker-ce/ubuntu/) y [Docker-compose](https://docs.docker.com/compose/install/#install-compose).

### Como usar

De forma automática se creará una imagen Wordpress y Wordpress Cli, se instalará WooCommerce con el tema Storefront y se creará un producto de ejemplo.

Para instalar Woocommerce, hacer lo siguiente y esperar 5 minutos:

```
docker compose up
```

Para Eliminar ejecutar y borrar las carpetas 'db_data' y 'wp_data':

```
docker compose down
```

### Paneles

**Web server:** http://localhost:8000

**Admin:** http://localhost:8000/wp-admin

user: admin
password: admin
Loading

0 comments on commit 1c2e448

Please sign in to comment.