version: '3.3'
services:
   db:
     image: mysql:5.7
     container_name: caravan-builder-wp
     ports:
       - "3307:3306"  # Expose MySQL on port 3306
     volumes:
       - db_data_caravan:/var/lib/mysql
     restart: always
     environment:
       MYSQL_ROOT_PASSWORD: rootpasswd
       MYSQL_DATABASE: cbuilder
       MYSQL_USER: cbuildau
       MYSQL_PASSWORD: rootpass
   wordpress:
     depends_on:
       - db
     image: wordpress:latest
     container_name: cbuilder-wordpress
     ports:
       - "8004:80"
     restart: always
     environment:
       WORDPRESS_DB_HOST: db:3306  # Keep using the internal port (3306)
       WORDPRESS_DB_USER: cbuildau
       WORDPRESS_DB_PASSWORD: rootpass
       WORDPRESS_DB_NAME: cbuilder
     working_dir: /var/www/html
     volumes:
      - ./wp-config.php:/var/www/html/wp-config.php
      - ./wp-content:/var/www/html/wp-content
      - ./uploads.ini:/usr/local/etc/php/conf.d/uploads.ini
   phpmyadmin:
      depends_on:
       - db
      image: phpmyadmin/phpmyadmin
      container_name: phpmyadminCBuilderWp
      environment:
      #  - PMA_HOST=db
       - PMA_PORT=3306  # phpMyAdmin connects to internal port
      #  - PMA_USER=cccorgmk
      #  - PMA_PASSWORD=rootpass
       - PMA_ARBITRARY=1  # Allow pma to select an arbitrary server
       - UPLOAD_LIMIT=3000000000
      restart: always
      ports:
       - 8086:80
      volumes:
       - /sessions
       - ./uploads.ini:/usr/local/etc/php/conf.d/php-phpmyadmin.ini
volumes:
     db_data_caravan: {}