forked from coopcycle/coopcycle-plugins
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose-wordpress.yml
102 lines (88 loc) · 3 KB
/
docker-compose-wordpress.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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
# https://github.com/chriszarate/docker-compose-wordpress
version: '3.3'
services:
wordpress_db:
image: mariadb:10.3
volumes:
- wordpress_dbdata:/var/lib/mysql
environment:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: wordpress
MYSQL_USER: wordpress
MYSQL_PASSWORD: wordpress
wordpress:
image: wordpress:5.2-apache
depends_on:
- wordpress_db
ports:
- "8083:80"
environment:
WORDPRESS_DB_HOST: wordpress_db:3306
WORDPRESS_DB_USER: wordpress
WORDPRESS_DB_PASSWORD: wordpress
volumes:
- "wordpress:/var/www/html:rw"
- "./wordpress:/var/www/html/wp-content/plugins/coopcycle:ro"
wp:
image: wordpress:cli-2.2.0-php7.3
# https://github.com/docker-library/wordpress/issues/256
user: xfs
depends_on:
- wordpress_db
- wordpress
volumes:
- "wordpress:/var/www/html:rw"
- "./wordpress:/var/www/html/wp-content/plugins/coopcycle:ro"
- "./wordpress/i18n/languages:/var/www/html/wp-content/plugins/coopcycle/i18n/languages:rw"
# $ are replaced with $$ to avoid the error 'Invalid interpolation format for "command" option'
entrypoint:
- bash
- -c
- |
if ! $$(wp core is-installed); then
echo "Installing WordPress…"
wp core install --url=localhost:8083 --title=CoopCycle --admin_user=admin --admin_password=admin [email protected] --skip-email
else
echo "WordPress is installed"
fi
if ! $$(wp plugin is-installed woocommerce); then
echo "Installing WooCommerce…"
wp plugin install woocommerce --activate
else
echo "WooCommerce is installed"
fi
if ! $$(wp plugin is-installed woocommerce-gateway-stripe); then
echo "Installing WooCommerce Stripe Payment Gateway…"
wp plugin install woocommerce-gateway-stripe --activate
else
echo "WooCommerce Stripe Payment Gateway is installed"
fi
if ! $$(wp theme is-installed storefront); then
echo "Installing Storefront theme…"
wp theme install storefront --activate
else
echo "Storefront theme is installed"
fi
if ! $$(wp plugin is-installed wordpress-importer); then
echo "Installing WordPress Importer…"
wp plugin install wordpress-importer --activate
else
echo "WordPress Importer is installed"
fi
echo "Installing WooCommerce pages…"
wp wc tool run install_pages --user=admin
echo "Importing WooCommerce sample products…"
wp import wp-content/plugins/woocommerce/sample-data/sample_products.xml --authors=skip
if ! $$(wp plugin is-active coopcycle); then
echo "Activating CoopCycle…"
wp plugin activate coopcycle
else
echo "CoopCycle is activated"
fi
volumes:
wordpress_dbdata:
wordpress:
networks:
default:
external:
name: coopcycle-web_default