friendica / docker

Docker image for Friendica
https://friendi.ca
GNU Affero General Public License v3.0
44 stars 18 forks source link

Improve documentation on attaching MySQL database #242

Open Fleker opened 6 months ago

Fleker commented 6 months ago

Hey folks, I am have been working towards setting up a local instance of Friendica and I had hoped the Docker container would be a good way to quickly bootstrap something usable. However, I have found myself stalled amidst several setup issues and I have been having difficulty understanding the documentation.

In particular, I have been able to load the Friendica installer on localhost and get to the DB page. However, I am stuck as I can't seem to connect to my database. image

I've created a docker-compose.yml which I can start up and it does show both services running and I can access them via Docker. However, they don't seem to talk to each other. I have tried alternatively using MariaDB v MySQL and either way it gives me that error. In addition, I have looked at the logs in both services without spotting any obvious errors.

I'm using a local image to get around #241.

version: "2"
# See https://hub.docker.com/_/friendica
services:
  friendica:
    image: friendica-beantown1
    depends_on:
      - db
    ports:
      - "8080:80"
    volumes:
      - friendica:/var/www/html
    environment: 
      - MYSQL_HOST=db
      - MYSQL_USER=friendica
      - MYSQL_PASSWORD=
      - MYSQL_DATABASE=friendica
  db:
    image: mariadb:latest  # Or mysql:latest
    # image: mysql:latest  # Or mysql:latest
    restart: always
    volumes:
      - db:/var/lib/mysql
    environment:
      - MYSQL_USER=friendica
      - MYSQL_PASSWORD=
      - MYSQL_DATABASE=friendica
      - MYSQL_RANDOM_ROOT_PASSWORD=no

volumes:
  db: {}
  friendica: {}

It'd be great if I'm missing something simple, but efforts to improve the setup docs may generally be helpful.

nupplaphil commented 5 months ago

@Fleker

why do you use beantowndb as DB servername? it should be db (as set in the docker-compose.yml). Same goes to the DB username (friendica instead of root).

For a quick setup, use the auto-installer feature, described here: https://github.com/friendica/docker?tab=readme-ov-file#automatic-installation