solidnerd / docker-bookstack

BookStack in a container
MIT License
457 stars 196 forks source link

Missing Link in docker-compose.yml #484

Closed Zwiebaechcken closed 5 months ago

Zwiebaechcken commented 5 months ago

Hello! I was just messing around with bookstack and had problems deploying it. As it turned out there is a missing link for bookstack to mysql in the docker-compose.yml.

Here's how I got it working:

version: '2'
services:
  mysql:
    image: mysql:8.3
    environment:
      - MYSQL_ROOT_PASSWORD=###
      - MYSQL_DATABASE=bookstackdb
      - MYSQL_USER=bookstackuser
      - MYSQL_PASSWORD=####
    volumes:
      - mysql-data:/var/lib/mysql

  bookstack:
    image: solidnerd/bookstack:24.2.3-1
    depends_on:
      - mysql
    environment:
      - DB_HOST=mysql:3306
      - DB_DATABASE=bookstackdb
      - DB_USERNAME=bookstackuser
      - DB_PASSWORD=###
      - APP_URL=http://localhost:8080
      - APP_KEY=###
    volumes:
      - uploads:/var/www/bookstack/public/uploads
      - storage-uploads:/var/www/bookstack/storage/uploads
    ports:
      - "8080:8080"
   #Here is what I added
    links:
      - mysql

volumes:
  mysql-data:
  uploads:
  storage-uploads:
HJF9w commented 5 months ago

Docker links are deprecated and should not be used anymore. if I remember correctly, since docker 1.13?? it is recommended to use docker networks. For me, using Docker version 24.0.5 and Docker Compose version 2.23.1, the sample docker-compose.yml works fine.

More information can be found at https://docs.docker.com/network/links/ https://docs.docker.com/network/

Zwiebaechcken commented 5 months ago

Thanks for the information! It kinda weird, I´v tried to deploy it on our portainer-server and on my laptop but both only started to work with the "link:" line. Well it works and im happy so im gonna close the issue! :)