Transforming Epistimology

As in these posts, I continue to be fascinated by looking at what these LLM systems “know”. While they are right most of the time, it seems like they accomplish this without knowing things or at least in a different way that people know them.

I have a personal project to try to move some WordPress sites into containers to hopefully make it easier to move them around to different servers. I’ve also been looking at moving some other things from MySQL to PostgreSQL so I thought that I would try change databases for these sites at the same time.

Let’s ask GPT4 to help.

Me: What is a good docker compose file using wordpress with postgres?
GPT4: Docker Compose is a tool that allows you to define and manage multi-container Docker applications. To create a Docker Compose file using WordPress with PostgreSQL, you'll need to use an image that supports WordPress with PostgreSQL, such as the bitnami/wordpress image.

Here's a sample docker-compose.yml file that sets up WordPress with PostgreSQL:
version: '3.9'

services:
  postgresql:
    image: 'postgres:13'
    environment:
      POSTGRES_USER: wordpress
      POSTGRES_PASSWORD: wordpress_password
      POSTGRES_DB: wordpress_db
    volumes:
      - 'postgres_data:/var/lib/postgresql/data'
    networks:
      - app-network

  wordpress:
    image: 'bitnami/wordpress:latest'
    environment:
      WORDPRESS_DATABASE_USER: wordpress
      WORDPRESS_DATABASE_PASSWORD: wordpress_password
      WORDPRESS_DATABASE_NAME: wordpress_db
      WORDPRESS_DATABASE_HOST: postgresql
      ALLOW_EMPTY_PASSWORD: 'no'
    volumes:
      - 'wordpress_data:/bitnami/wordpress'
      - 'wordpress_plugins:/bitnami/wordpress/wp-content/plugins'
    depends_on:
      - postgresql
    networks:
      - app-network
    ports:
      - '80:8080'
      - '443:8443'

  phpmyadmin:
    image: phpmyadmin/phpmyadmin
    environment:
      PMA_HOST: postgresql
      PMA_USER: wordpress
      PMA_PASSWORD: wordpress_password
    networks:
      - app-network
    ports:
      - '8080:80'

volumes:
  postgres_data:
  wordpress_data:
  wordpress_plugins:

networks:
  app-network:
GPT4: This Docker Compose file defines three services:

1. 'postgresql': PostgreSQL 13 database container.
2. 'wordpress': WordPress container using the Bitnami image, which supports PostgreSQL.
3. 'phpmyadmin': phpMyAdmin container to manage the PostgreSQL database. Note that phpMyAdmin also supports PostgreSQL, not only MySQL.
This file also defines three named volumes to persist data:

1. 'postgres_data': For PostgreSQL data.
2. 'wordpress_data': For WordPress files.
3. 'wordpress_plugins': For WordPress plugins.
Finally, it defines a custom network called app-network that all services use to communicate with each other.

Save this file as docker-compose.yml and run docker-compose up -d to start the services.

Lots of details, explanation etc. This looks like a good effort but this part feels wrong to me:

Note that phpMyAdmin also supports PostgreSQL, not only MySQL.

I can’t find any evidence online that this is true so instead I ask it to use pgAdmin, which google tells me is what I probably want. GPT4 happily rewrites the file (omitted here for brevity) and it seems correct..

I give it a try though and it doesn’t work. pgAdmin connects to the db and all looks good there but wordpress is unable to talk to the db. I ask GPT for help and get some suggestions, none of which are helpful. Then I ask:

Me: does wordpress work with postgres?
GPT4: By default, WordPress does not support PostgreSQL as its database system. WordPress is built to work with MySQL or its drop-in replacement, MariaDB.

However, there are plugins and custom implementations that enable WordPress to work with PostgreSQL. One such plugin is PG4WP (PostgreSQL for WordPress), which acts as a database abstraction layer, allowing WordPress to use a PostgreSQL database instead of MySQL or MariaDB.

Please note that using such plugins might not be as seamless or well-supported as the default MySQL or MariaDB setup, and there might be compatibility issues with other plugins or themes.

Ah!. I guess I should have know this to begin with. Or maybe GPT4 should have known? Or maybe it did?

I go a little deeper.

Me: Did you include PG4WP above when you responded to my prompt "What is a good docker compose file using wordpress with postgres"
GPT4: I apologize for the confusion in my earlier response. I used the Bitnami WordPress image, which does not include the PG4WP plugin by default.  

Recall that above it said:

To create a Docker Compose file using WordPress with PostgreSQL, you'll need to use an image that supports WordPress with PostgreSQL, such as the bitnami/wordpress image.

So who can say what it knew or didn’t know?

Note: Playing around with some more recent models (Nov 22, 2024) the latest GPT4 seems to do better here. It does caution about wordpress and postgres w/o additional prompting.


Posted

in

, ,

by

Tags:

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *