docker pull wordpress:5.2.2-php7.3-fpm
docker network create -d bridge wordpress
docker run -d \
--name wordpress \
--network wordpress \
-e WORDPRESS_DB_HOST=db \
-e WORDPRESS_DB_USER= \
-e WORDPRESS_DB_PASSWORD= \
-e WORDPRESS_DB_NAME=wordpress \
-e WORDPRESS_TABLE_PREFIX=wp \
wordpress:5.2.2-php7.3-fpm
version: '3'
services:
wordpress:
image: wordpress:5.2.2-php7.3-apache
restart: always
ports:
- 8080:80
environment:
WORDPRESS_DB_HOST: db
WORDPRESS_DB_USER: user
WORDPRESS_DB_PASSWORD: password
WORDPRESS_DB_NAME: wordpress
working_dir: /var/www/html
volumes:
- ./wordpress/:/var/www/html/
db:
image: mysql:5.7
restart: always
environment:
MYSQL_DATABASE: wordpress
MYSQL_USER: user
MYSQL_PASSWORD: password
MYSQL_RANDOM_ROOT_PASSWORD: '1'
ports:
- "127.0.0.1:3306:3306"