phpbb in docker

Do not post support requests, bug reports or feature requests. Discuss phpBB here. Non-phpBB related discussion goes in General Discussion!
Get Involved
Post Reply
FASherman
Registered User
Posts: 13
Joined: Sat May 10, 2003 2:26 pm

phpbb in docker

Post by FASherman »

Here is the docker-compose.yaml file.

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
Create a directory, phpbb. Save the yaml file in that directory. Execute, as root (docker commands are always are root):
# 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
(I've seen some implementations where everything is in one container, but that violates the basic tenet of docker: one serve, on container.)

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.
Last edited by Mick on Wed Apr 05, 2023 9:27 am, edited 1 time in total.
Reason: Solved.
FASherman
Registered User
Posts: 13
Joined: Sat May 10, 2003 2:26 pm

Re: phpbb in docker

Post by FASherman »

If anyone is interested I figured this out for a 3 node (1 master / 2 workers) Kubernetes environment (docker orchestrator). The result is dual-master mysql servers, load balanced apache servers and a phpmyadmin for admin. A HAProxy server sits in front and provides the load balancing.
ivzgrace
Registered User
Posts: 1
Joined: Tue Apr 04, 2023 6:27 pm

Re: phpbb in docker

Post by ivzgrace »

Hi, is there an update of the yml for php 8?
phpbuser19
Registered User
Posts: 28
Joined: Mon Aug 16, 2021 9:36 pm

Re: phpbb in docker

Post by phpbuser19 »

If you are interested in running phpbb as a docker container - please take a look at https://github.com/bitnami/containers/t ... pbb#readme
Post Reply

Return to “phpBB Discussion”