mkdir wordpress
cd wordpress
touch docker-compose.yml
vi docker-compose.yml
version: '3.3'
services:
db:
image: mysql:5.7
ports:
- "3306:3306"
volumes:
- db_data:/var/lib/mysql
restart: always
environment:
MYSQL_ROOT_PASSWORD: wordpress
MYSQL_DATABASE: wordpress
MYSQL_USER: wordpress
MYSQL_PASSWORD: wordpress
wordpress:
depends_on:
- db
image: wordpress:latest
ports:
- "80:80"
restart: always
environment:
WORDPRESS_DB_HOST: db:3306
WORDPRESS_DB_USER: wordpress
WORDPRESS_DB_PASSWORD: wordpress
volumes:
db_data:
docker image prune --all
docker-compose restart
docker-compose build
docker-compose stop
docker-compose start
docker-compose up
sudo ufw enable
sudo ufw allow ssh
sudo ufw allow 80/tcp
sudo ufw allow 3306
sudo service ufw restart
sudo ufw status
No comments:
Post a Comment