Skip to content

Instantly share code, notes, and snippets.

@bellerbrock
Last active October 21, 2019 01:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bellerbrock/e3d43041752e3d2c50def5be1f4e5645 to your computer and use it in GitHub Desktop.
Save bellerbrock/e3d43041752e3d2c50def5be1f4e5645 to your computer and use it in GitHub Desktop.
Deploying breedbase via docker
#Docker deployments are now even easier and handled via docker-compose
git clone https://github.com/solgenomics/breedbase_dockerfile.git
cd breedbase_dockerfile
# For development
./prepare.sh
mkdir archive
mv sgn_local.conf.template sgn_local.conf # Edit default and add web_usr password
sudo docker-compose up -d
sudo docker exec -e COLUMNS="`tput cols`" -e LINES="`tput lines`" -ti breedbase_db bash
psql -U postgres # pw is postgres
\password web_usr # alter to match password added to sgn_local.conf
You're all set! Exit your terminal, open a browser and go to localhost:7080
To track error output will devleoping just run
docker logs breedbase_web
# For production
sudo docker-compose -f docker-compose.yml -f production.yml up -d
#Below info is deprecated.
# The example here will be with images from dockerhub, but it's also possible to clone and build from github like so
# git clone https://github.com/solgenomics/postgres_dockerfile
# cd postgres_dockerfile/
# docker build -t breedbase_db postgres_dockerfile
# docker run -dti --name breedbase_db -h breedbase_db -p 5432:5432 breedbase_db
# create necessary directory structure on host for conf file and file system. Copy minimal information into conf file from sgn_local.conf gist
# add handy docker aliases from docker_aliases.txt gist to .bash_aliashes and run source ~/.bash_aliases if desired
mkdir -p /data/breedbase/public_breedbase
mkdir /data/breedbase/archive
touch /data/breedbase/sgn_local.conf
# breedbase-web from dockerhub. mapping container port 8080 to host port 7080 so it won't conflict with host apache server
sudo docker run -dti --name breedbase_web -h breedbase -p 7080:8080 -v /data/breedbase/sgn_local.conf:/home/production/cxgn/sgn/sgn_local.conf -v /data/breedbase/archive:/home/production/archive -v /data/breedbase/public_breedbase:/home/production/public breedbase/breedbase:v0.3
# breedbase-db from dockerhub. No need to map postgres ports, but could do `-p 5433:5432` if desired for direct psql connection from host
sudo docker run -dti --name breedbase_db -h breedbase_db breedbase/pg
#create and connect network
sudo docker network create bbase-net
sudo docker network connect bbase-net breedbase_web
sudo docker network connect bbase-net breedbase_db
#how to remove before rebuilding and reconnecting
sudo docker network disconnect bbase-net breedbase_web
sudo docker rm -f breedbase_web
sudo docker image rm breedbase/breedbase:v0.3
Breedbase will be accessible from a browser on the host by going to localhost:7080
For troubleshooting, connect to the breedbase-web docker and check the error log in /var/log/sgn/error.log
The server can be stopped and started using `sudo service sgn stop` and `sudo service sgn start`
configuration edits can be made to sgn_local.conf
# Docker compose
sudo docker-compose up -d breedbase
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment