Trouble Loading with Docker Compose and Caddy

If you’re looking for some help, it’s important to provide as much context as possible so that people are able to assist you. Try to always mention:

  • Private domain so don’t want to share as it’s for testing
  • What configuration? Docker Compose
  • What browser? Safari

So I configured ghost with docker and caddy using docker compose. All the docker pods launched and if I go to my url I can access the URL but it loads a blank page, just white no error codes.

I am attaching my docker compose file as I know it’s not a problem with the caddy configuration but unsure what I did wrong with the ghost or db part


version: "3.3"

networks:
     web:
      external: true
     internal:
      external: false
      driver: bridge

services: 
 caddy:
     image: caddy:2-alpine
     restart: unless-stopped
     ports:
      - "80:80"
      - "443:443"
     volumes:
      - /data/caddy/Caddyfile:/etc/caddy/Caddyfile
      - /data/caddy/data:/data # Optional
      - /data/caddy/config:/config # Optional
     networks:
      - web
      - internal
 ghost:
    image: ghost:latest
    restart: always
    depends_on:
      - db
    environment:
      url: http://localhost:2368
      database__client: mysql
      database__connection__host: db
      database__connection__user: desiredusername
      database__connection__password: mypassword
      database__connection__database: dbname
    volumes:
      - /home/ghost/content:/var/lib/ghost/content
    networks:
     - internal
 db:
    image: mariadb:latest
    restart: always
    environment:
      MYSQL_ROOT_PASSWORD: dbpasswordroot
      MYSQL_USER: desiredusername
      MYSQL_PASSWORD: desiredusername
      MYSQL_DATABASE: dbname
    volumes:
      - /home/ghost/mysql:/var/lib/mysql

Well okay so when I go on chrome I get a 502 error rather than a blank page so it is something with caddy and the docker networks but not sure what I did wrong in the above file