|
@@ -1,25 +1,29 @@
|
|
|
|
|
|
-MYSQL_PASSWORD="YOUR_MYSQL_PASSWORD"
|
|
|
-MYSQL_RUN_NAME="YOUR_MYSQL_RUN_NAME"
|
|
|
+
|
|
|
+DB_TYPE="postgres"
|
|
|
+DB_PASSWORD="YOUR_DB_PASSWORD"
|
|
|
+DB_RUN_NAME="YOUR_DB_RUN_NAME"
|
|
|
HOST_PORT="YOUR_HOST_PORT"
|
|
|
|
|
|
-
|
|
|
-sed -i "s/THE_MYSQL_PASSWORD/$MYSQL_PASSWORD/g" images/mysql/Dockerfile
|
|
|
-
|
|
|
-sed -i "s/THE_MYSQL_PASSWORD/$MYSQL_PASSWORD/g" images/gogits/deploy.sh
|
|
|
+
|
|
|
+sed -i "s/THE_DB_PASSWORD/$DB_PASSWORD/g" images/$DB_TYPE/Dockerfile
|
|
|
+
|
|
|
+sed -i "s/THE_DB_PASSWORD/$DB_PASSWORD/g" images/gogits/deploy.sh
|
|
|
+
|
|
|
+sed -i "s/THE_DB_TYPE/$DB_TYPE/g" images/gogits/deploy.sh
|
|
|
|
|
|
-
|
|
|
-cd images/mysql
|
|
|
-docker build -t gogs/mysql .
|
|
|
+
|
|
|
+cd images/$DB_TYPE
|
|
|
+docker build -t gogs/$DB_TYPE .
|
|
|
|
|
|
|
|
|
cd ../gogits
|
|
|
docker build -t gogs/gogits .
|
|
|
|
|
|
|
|
|
-docker run -d --name $MYSQL_RUN_NAME gogs/mysql
|
|
|
+docker run -d --name $DB_RUN_NAME gogs/$DB_TYPE
|
|
|
|
|
|
-
|
|
|
-echo "Now we have the MySQL image(running) and gogs image, use the follow command to start gogs service:"
|
|
|
-echo -e "\033[33m docker run -i -t --link $MYSQL_RUN_NAME:db -p $HOST_PORT:3000 gogs/gogits \033[0m"
|
|
|
+
|
|
|
+echo "Now we have the $DB_TYPE image(running) and gogs image, use the follow command to start gogs service:"
|
|
|
+echo -e "\033[33m docker run -i -t --link $DB_RUN_NAME:db -p $HOST_PORT:3000 gogs/gogits \033[0m"
|
|
|
|