-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
72 lines (68 loc) · 1.83 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
version: "3.8"
# NOTE! This docker container has hard-coded values for passwords - this is intentional as this is testing machine. DO NOT EXPOSE TO THE INTERNET.
# Nuke
# docker-compose down
# docker-compose rm -sf database
# docker volume rm docker_db-data
# docker-compose up --build
# open a new terminal tab and run
# docker-compose exec wordpress bash -c "cd /var/www/html && source /root/.bashrc && dbinit && create_posts"
services:
database:
image: mariadb:10.6.4-focal
restart: unless-stopped
ports:
- 3306:3306
environment:
MYSQL_ROOT_PASSWORD: 'CTBB_ROOT_PASSWD'
MYSQL_DATABASE: 'CTBB_WP_DB'
MYSQL_USER: 'CTBB_WP_DB_USER'
MYSQL_PASSWORD: 'CTBB_WP_DB_PASSWD'
volumes:
- db-data:/var/lib/mysql
networks:
- wordpress-network
deploy:
resources:
limits:
memory: 2048m
phpmyadmin:
platform: linux/amd64
depends_on:
- database
image: phpmyadmin/phpmyadmin
restart: unless-stopped
ports:
- 1338:80
environment:
PMA_HOST: database
MYSQL_ROOT_PASSWORD: 'CTBB_ROOT_PASSWD'
networks:
- wordpress-network
wordpress:
depends_on:
- database
build:
context: .
dockerfile: Dockerfile
restart: unless-stopped
ports:
- 1337:80
environment:
WORDPRESS_DB_HOST: database:3306
WORDPRESS_DB_NAME: 'CTBB_WP_DB'
WORDPRESS_DB_USER: 'CTBB_WP_DB_USER'
WORDPRESS_DB_PASSWORD: 'CTBB_WP_DB_PASSWD'
WP_CLI_ALLOW_ROOT: 'true' # to omit the --allow-root
PHP_EXTENSION_XDEBUG: 1
volumes:
- ./wp-content:/var/www/html/wp-content
- ./wp_helpers.sh:/root/.bashrc
- ./php.ini:/usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
networks:
- wordpress-network
volumes:
db-data:
networks:
wordpress-network:
driver: bridge