Dockerfile
version: "3.9"
services:
wordpress:
image: wordpress
container_name: wordpress
restart: always
ports:
- 8080:80
networks:
- wordpress
volumes:
- wordpress-data:/var/www/html
- ./wordpress-data:/var/www/html
depends_on:
- mysqldb
mysqldb:
image: mysql
container_name: mysql_db
restart: always
environment:
MYSQL_ROOT_PASSWORD: password
MYSQL_DATABASE: wordpress
MYSQL_USER: user
MYSQL_PASSWORD: password
ports:
- 3306:3306
volumes:
- mysql-data:/var/lib/mysql
- ./mysql-data:/var/lib/mysql
networks:
- wordpress
phpmyadmin:
image: phpmyadmin
container_name: admin
restart: always
ports:
- 80:80
networks:
- wordpress
environment:
- PMA_HOST=mysqldb
- PMA_USER=root
- PMA_PASSWORD=password
depends_on:
- mysqldb
networks:
wordpress:
volumes:
wordpress-data:
mysql-data:
Dockerfile
version: "3.9"
services:
db:
image: mysql:latest
container_name: mysql-db
restart: always
environment:
MYSQL_ROOT_PASSWORD: password
MYSQL_DATABASE: initialdatabase
MYSQL_USER: user
MYSQL_PASSWORD: password
ports:
- "3306:3306"
volumes:
- mysql-data:/var/lib/mysql
- ./data:/var/lib/mysql
- ./initdb.d:/docker-entrypoint-initdb.d
networks:
- node-mysql
app:
container_name: node-app
build: ./app
restart: always
ports:
- "3000:3000"
volumes:
- ./app:/usr/src/app/
networks:
- node-mysql
depends_on:
- db
phpmyadmin:
container_name: admin
image: phpmyadmin:latest
ports:
- "80:80"
networks:
- node-mysql
depends_on:
- db
wordpress:
container_name: wordpress
image: wordpress:latest
restart: always
ports:
- "8080:80"
networks:
- node-mysql
depends_on:
- db
volumes:
- wordpress-data:/var/www/html
- ./wordpressData:/var/www/html
- ./wordpress/php.ini:/usr/local/etc/php/conf.d/php.ini
networks:
node-mysql:
volumes:
wordpress-data:
mysql-data: