Skip to content

Install with Docker Compose

  1. Create a docker-compose.yml file for the project

    docker-compose.yml
    services:
    biblioteca:
    image: ghcr.io/biblioverse/biblioteca:main
    command: ["/bin/sh", "-c" , "apache2-foreground" ]
    ports:
    - 8080
    depends_on:
    - db
    stdin_open: true
    tty: true
    volumes:
    - <cover_folder>:/var/www/html/public/covers
    - <books_folder>:/var/www/html/public/books
    - <image_cache_folder>:/var/www/html/public/media
    - .env:/var/www/html/.env
    db:
    image: mariadb:10.10
    environment:
    - MYSQL_ROOT_PASSWORD=db
    - MYSQL_DATABASE=db
    - MYSQL_USER=db
    - MYSQL_PASSWORD=db
    volumes:
    - mariadb2:/var/lib/mysql
    typesense:
    image: typesense/typesense:0.26.0.rc46
    restart: on-failure
    ports:
    - 8983
    - 8108
    volumes:
    - searchdata:/data
    command: '--data-dir /data --api-key=xyz --enable-cors'
    volumes:
    mariadb:
    searchdata:
    • Don’t forget to replace the database password and the typesense.
    • Change the folders with the path you want to use to store the books on your machine.
  2. Create a .env file with the following content:

    APP_SECRET=your_secret
    DATABASE_URL=mysql://db:db@db:3306/db
    TYPESENSE_KEY=xyz
  3. Run the following command to start the project:

    Terminal window
    docker-compose up -d
  4. Run the followng commands to create the database and the admin user:

    Terminal window
    docker compose exec biblioteca bin/console doctrine:migration:migrate --no-interaction
    docker compose exec biblioteca bin/console app:create-admin-user [name] [password]
    docker compose exec biblioteca bin/console typesense:create
  5. Access the application at http://localhost:8080

  6. You can login with the name and password you set in step 4