Skip to content

arey/musicbrainz-database

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 

Docker container for the MusicBrainz database

Docker Hub

Based on the official Postgres image, this docker image installs a PostgreSQL 9.5.10 wilh all librairies required by the MusicBrainz database.

This image comes with a create-database.sh shell script used to create and feed the database:

  • Create the musicbrainz schema
  • Create all tables
  • Import the last MusicBrainz database export
  • Add index and primary keys

SQL scripts are retrieved from the MusicBrainz Github repo.

Build the image

The arey/musicbrainz-database image is published to Docker Hub. Docker will automatically download it. If you prefer to build it manually after retrieving source code from GitHub:

git clone https://github.com/arey/musicbrainz-database.git
cd musicbrainz-database
docker build -t arey/musicbrainz-database .

Run the container and import the musicbrainz data

docker run -t -d -p 5432:5432 --name musicbrainz-database -e POSTGRES_USER=musicbrainz -e POSTGRES_PASSWORD=musicbrainz arey/musicbrainz-database

If you have host-based storage available for the Postgres DB files (recommended), adjust the above base command with a this parameter: -v /path/to/storage/location:/var/lib/postgresql

docker run -it --link musicbrainz-database:postgresql -e POSTGRES_USER=musicbrainz -e POSTGRES_PASSWORD=musicbrainz --rm arey/musicbrainz-database /create-database.sh

Test it

In order to test your database installation, execute the below SQL query:

docker run -it --link musicbrainz-database:postgresql --rm arey/musicbrainz-database sh -c 'exec psql -h postgresql -d musicbrainz -U musicbrainz -a -c "SELECT COUNT(*) FROM artist"'

Enter the 'musicbrainz' password. A minimum number of 995899 artists should be counted.

Connect to the database

From Java application, use the following JDBC URL: jdbc:postgresql://localhost:5432/musicbrainz and the credentials: musicbrainz / musicbrainz

Note: For Microsoft Windows or MacOS users, please replace localhost with the boot2docker IP.

About

Docker container for the MusicBrainz PostgreSQL database

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages