-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdocker-compose.yml
57 lines (55 loc) · 1.25 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
version: '3.8'
services:
php:
build:
context: .
dockerfile: Dockerfile
ports:
- 81:80
volumes:
- ./src:/var/www/html/
networks:
- lan
db: # mysql database server
image: mysql:latest
restart: always #this restarts the service upon any configuration changes
environment: # to use and access MySQL server,we neet to set up an authentication environment
MYSQL_ROOT_PASSWORD: password
ports:
- "6034:3306" #6034 in the the local machine and 3306 in the container
volumes: # it persists updates made to the database
- dbdata:/var/lib/mysql
networks:
- lan
phpmyadmin: #another service to manage database server
depends_on:
- db
image: phpmyadmin/phpmyadmin
restart: always
ports:
- '82:80'
environment:
PMA_HOST: db
networks:
- lan
# Wordpress
wordpress:
depends_on:
- db
image: wordpress:latest
ports:
- '83:80'
restart: always
volumes:
- ./wordpress:/var/www/html
environment:
WORDPRESS_DB_HOST: db:3306
WORDPRESS_DB_USER: wordpress
WORDPRESS_DB_PASSWORD: wordpress
MYSQL_DATABASE: wordpress
networks:
- lan
volumes:
dbdata:
networks:
lan: