-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
27 lines (25 loc) · 927 Bytes
/
docker-compose.yml
File metadata and controls
27 lines (25 loc) · 927 Bytes
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
services:
db:
image: mysql:8.0 # Or use mysql:5.7 for older versions
restart: always
environment:
MYSQL_ROOT_PASSWORD: root # Replace with a strong password
MYSQL_DATABASE: wordpress # Optional: create a default database
MYSQL_USER: wordpress # Optional: create a default user
MYSQL_PASSWORD: wordpress # Replace with a strong password
ports:
- "3306:3306" # Map MySQL port to host
volumes:
- wpexample_data:/var/lib/mysql # Persistent data volume
phpmyadmin:
image: phpmyadmin/phpmyadmin
restart: always
environment:
PMA_HOST: db # Connects to the 'db' service defined above
MYSQL_ROOT_PASSWORD: root # Use the same root password as MySQL
ports:
- "8080:80" # Map phpMyAdmin port to host
depends_on:
- db # Ensures 'db' starts before 'phpmyadmin'
volumes:
wpexample_data: # Define the named volume for data persistence