-
Notifications
You must be signed in to change notification settings - Fork 14
/
docker-compose.yml
79 lines (78 loc) · 3.81 KB
/
docker-compose.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
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:
platform: linux/x86_64
image: mysql:5.7
container_name: php8.2-wp6.7.1-wc2.11.0-woo9.4.2_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.7.1-php8.2-apache
container_name: php8.2-wp6.7.1-wc2.11.0-woo9.4.2_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.11.0-php8.2
container_name: php8.2-wp6.7.1-wc2.11.0-woo9.4.2_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=9.4.2 --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