Code: Select all
version: '3.8'
services:
database:
image: mariadb:latest
restart: always
environment:
MYSQL_ROOT_PASSWORD: YOUR PASSWORD HERE
ports:
- '3306:3306'
expose:
- '3306'
networks:
app_net:
ipv4_address: 192.168.3.2
volumes:
- my_db:/var/lib/mysql
phpmyadmin:
image: phpmyadmin/phpmyadmin:latest
links:
- database:mysql
ports:
- "8080:80"
environment:
MYSQL_ROOT_PASSWORD: PASSWORD FROM ABOVE
PMA_HOST: mysql
PMA_PORT: 3306
networks:
app_net:
ipv4_address: 192.168.3.3
html:
image: fasherman/apache-php:latest
ports:
- '80:80'
- '443:443'
volumes:
- my_html:/var/www/html
depends_on:
- database
networks:
app_net:
ipv4_address: 192.168.3.4
volumes:
my_html:
driver: local
my_db:
driver: local
networks:
app_net:
driver: bridge
ipam:
driver: default
config:
- subnet: 192.168.3.0/24
# docker-compose up -d
In less that 2 minutes, you'll have three fully functional containers on your docker host:
- aMiriaDB server, fully configured
phpmyadmin, ready to admin the database
Apache w/ PHP 7.4
The yaml file creates to two persistent volumes:
# docker volume ls
DRIVER VOLUME NAME
local phpbb_my_db
local phpbb_my_html
As you can see, one is for the database, the other is the html source. Both of these will reside as directories on you docker host as:
/var/lib/docker/volumes/phpbb_my_db/_data
/var/lib/docker/volumes/phpbb_my_html/_data
Drop your phpbb source in /var/lib/docker/volumes/phpbb_my_html/_data and install like normal.
Message me if you have any questions or need assistance.