Skip to content

createsafe/docker-musicbrainz-graphql

Repository files navigation

docker-musicbrainz-graphql

This project is a way to get up and running quickly with Docker, Graphql, and the Musicbrainz Database by leveraging the power of graphile. In under 10 minutes, you will be able to immediatly begin work with the MusicBrainz DB. The returned data follows the Relay specification.

image

Quick Start

There are only 3 three steps to follow to get this up and running

  1. Get the database
  2. Provision Docker
  3. Run the container

1. Get the database

If you don't want to pull down the full production dump, you can download the sample db. If you're using the full db export, skip to step 2.

You cannot use the sample from their website, as unfrotunately it's in a diff format from the full db dumps (why?).

Once you've downloaded the DB and cloned this repo, put the sample db (mbdump-sample.tar.bz2) into the mbslave directory in the repo.

Make sure to change the permissions so the container can read the sample db, on linux chmod 777.

Now there are two more steps to run.

2. Provision Docker

npm run init_db:sample

Or to pull the full Musicbrainz DB

npm run init_db:production

The database will begin to initialize. You should see mesages like CREATE VIEW, CREATE INDEX, etc. when the initialization has concluded you will get a message like INITIALIZATION DONE, PRESS CTRL+C to end container, and run with npm run start. Now stop the process, and run the next command.

3. Run the container

npm run start

This will run docker compose, setup the node and db containers, and run the node server on port 49000. Navigating to localhost:49000/graphiql will now open the graphql playground.

You can inspect all available queries by clicking 'docs' in the upper right hand corner. image

If you'd like a sample query to immediately see results, try this:

query getAll {
  allTracks(first: 100) {
    nodes {
      name
    }
  }
}

musicbrainz

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published