Fungsi
Wordpress adalah Content Management System (CMS) yang kebiasaan dipakai oleh kebanyakan website.
Environment
- Ubuntu 22.04 LTS
- Docker 20.10.12
Install docker
1
2
| sudo apt install docker.io
sudo apt install docker-compose
|
Bina folder
1
2
| mkdir wordpress
cd wordpress
|
Bina docker-compose.yaml file
1
| touch docker-compose.yaml
|
Edit docker-compose.yaml file
1
| nano docker-compose.yaml
|
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
| version: "3.9"
services:
wordpress-db:
image: mariadb
volumes:
- wordpress-db:/var/lib/mysql
restart: unless-stopped
environment:
- MYSQL_RANDOM_ROOT_PASSWORD=yes
- MYSQL_PASSWORD=wordpress
- MYSQL_USER=wordpress
- MYSQL_DATABASE=wordpress
networks:
wordpress-back-network:
wordpress:
depends_on:
- wordpress-db
image: wordpress:latest
volumes:
- wordpress_data:/var/www/html
ports:
- "80:80" # hostport:containerport
restart: unless-stopped
environment:
WORDPRESS_DB_HOST: wordpress-db
WORDPRESS_DB_USER: wordpress
WORDPRESS_DB_PASSWORD: wordpress
WORDPRESS_DB_NAME: wordpress
networks:
wordpress-back-network:
volumes:
wordpress-db:
wordpress_data:
networks:
wordpress-back-network:
driver: bridge
|
Run docker-compose
1
| sudo docker-compose up -d
|
Login ke admin UI
http://localhost/wp-admin
Link berguna