-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
53 lines (51 loc) · 1.73 KB
/
Copy pathdocker-compose.yml
File metadata and controls
53 lines (51 loc) · 1.73 KB
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
services:
wordpress:
#image: wordpress:latest
build: .
ports:
- "8080:80" # Maps host port 8080 to container port 80
extra_hosts:
localhost.local: 127.0.0.1
environment:
WORDPRESS_DB_HOST: db
WORDPRESS_DB_USER: wordpress
WORDPRESS_DB_PASSWORD: wordpress
WORDPRESS_DB_NAME: wordpress
WORDPRESS_DEBUG: true
WORDPRESS_CONFIG_EXTRA: |
define('WP_HOME', 'http://localhost:8080/');
define('WP_SITEURL', 'http://localhost:8080/');
define('WP_DEBUG_LOG', true);
define('WP_DEBUG_DISPLAY', false);
WORDPRESS_PLUGINS: |
my-calendar
ninja-forms
depends_on:
- db
volumes:
- wordpress_data:/var/www/html # Persists WordPress data.
- ./wp.sh:/usr/local/bin/wp:ro
- ./quickinstall.sh:/usr/local/bin/quickinstall:ro
- ./.htaccess:/var/www/html/.htaccess:ro
# If this folder does not already exist on your system, it might get set up
# as another user, e.g. root. To resolve that, you can create the directory
# yourself before you bring up the docker image, and then you can work inside
# the directory without any issues.
- ./my-plugin:/var/www/html/wp-content/plugins/my-plugin
restart: always
db:
image: mariadb:latest # Or mariadb:10.11, mariadb:10.6, etc. Specify version if needed
ports:
- "33306:3306"
environment:
MYSQL_ROOT_PASSWORD: root # VERY IMPORTANT: Change this!
MYSQL_DATABASE: wordpress
MYSQL_USER: wordpress
MYSQL_PASSWORD: wordpress
# command: --bind-address=127.0.0.1 # prevent remote access
volumes:
- db_data:/var/lib/mysql # Persists database data
restart: always
volumes:
wordpress_data:
db_data: