Last active
August 29, 2015 14:27
-
-
Save leejsinclair/b46b6d35db9bfd0fda03 to your computer and use it in GitHub Desktop.
gitlab-private-bower-docker
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Variables | |
IP=$(ifconfig | grep 192 | awk '/inet addr/{print substr($2,6)}') | |
echo "*" | |
echo "* CREATING PRIVATE BOWER ENVIRONMENT" | |
echo "*" | |
echo "* Docker UI: http://$IP:9000" | |
echo "* Bower UI: http://$IP:5678" | |
echo "* GitLab UI: http://$IP:10080" | |
echo "*" | |
# Setup | |
mkdir -p ~/private-bower | |
mkdir -p ~/gitlab | |
mkdir -p ~/gitlab/postgresql | |
mkdir -p ~/gitlab/redis | |
mkdir -p ~/gitlab/data | |
sudo chmod -R 777 ~/gitlab/data | |
# Stop existing containers | |
echo "Stopping / cleaning up containers" | |
docker kill $(docker ps -q) | |
docker rm $(docker ps -a -q) | |
# Docker UI | |
docker run -d -p 9000:9000 --privileged -v /var/run/docker.sock:/var/run/docker.sock dockerui/dockerui | |
# GitLab | |
docker run --name gitlab-postgresql -d \ | |
--env 'DB_NAME=gitlabhq_production' \ | |
--env 'DB_USER=gitlab' --env 'DB_PASS=password' \ | |
--volume ~/gitlab/postgresql:/var/lib/postgresql \ | |
sameersbn/postgresql:9.4-3 | |
docker run --name gitlab-redis -d \ | |
--volume ~/gitlab/redis:/var/lib/redis \ | |
sameersbn/redis:latest | |
docker run --name gitlab -d \ | |
--link gitlab-postgresql:postgresql --link gitlab-redis:redisio \ | |
--publish 10022:22 --publish 10080:80 \ | |
--env 'GITLAB_PORT=10080' --env 'GITLAB_SSH_PORT=10022' \ | |
--env '[email protected]' --env 'SMTP_PASS=app-password' \ | |
--volume ~/gitlab/data:/home/git/data \ | |
sameersbn/gitlab:7.13.5 | |
# Bower Server | |
docker run -e ADDRESS=$IP \ | |
-v ~/private-bower:/data \ | |
-p 5678:5678 -p 6789:6789 -p 7891:7891 \ | |
tandrup/private-bower |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment