Created
October 30, 2017 06:07
-
-
Save JoeShi/39355e01e1a465d9e467af8cf11e5e24 to your computer and use it in GitHub Desktop.
Create a strong-pm server with one script
This file contains 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 | |
# update the yum package | |
yum update -y | |
# Install the docker CE on CentOS via the repo | |
# setup the repo | |
yum install -y yum-utils device-mapper-persistent-data lvm2 | |
# use the stable version of docker CE | |
yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo | |
# install docker-ce & setup the docker mirror | |
yum install -y docker-ce-17.09.0.ce | |
systemctl start docker | |
sudo mkdir -p /etc/docker | |
sudo tee /etc/docker/daemon.json <<-'EOF' | |
{ | |
"registry-mirrors": ["https://ftus2kx4.mirror.aliyuncs.com"] | |
} | |
EOF | |
sudo systemctl daemon-reload | |
sudo systemctl restart docker | |
# pull the strong-pm docker | |
docker pull strongloop/strong-pm | |
# start the docker container | |
docker run -d -p 8701:8701 --name=strong-pm -v /data/storage:/data/storage --env STRONGLOOP_PM_HTTP_AUTH=saltyegg:saltyeggadmin strongloop/strong-pm | |
docker pull nginx | |
docker run -p 80:80 -p 443:443 --name nginx -v /data/nginx/conf.d:/etc/nginx/conf.d -v /data/www:/usr/share/nginx/html -v /data/ssl:/etc/ssl -d nginx | |
# create the network | |
docker network create staging | |
docker network connect --alias strong-pm staging strong-pm | |
docker network connect --alias nginx staging nginx | |
# pull and setting up the mongo db service | |
docker pull mongo:3.2 | |
docker run --name mongod -v /data/mongod/:/data -d mongo:3.2 | |
docker network connect --alias mongod staging mongod | |
# install the Git Auto Deploy | |
docker run -t --name deploy --expose=8001 -v /data:/data -d centos | |
docker network connect --alias deploy staging deploy | |
docker pull qnch/github-gitlab-auto-deploy | |
# 这里怎么配置貌似还没有试过 | |
curl --silent --location https://rpm.nodesource.com/setup_8.x | sudo bash - | |
sudo yum -y install nodejs | |
# install the strongloop for build project | |
npm install -g strongloop --registry=https://registry.npm.taobao.org | |
# intall bzip2 | |
yum install bzip2 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment