diff --git a/README.md b/README.md index f3c6fd52..4ca9cb0b 100644 --- a/README.md +++ b/README.md @@ -199,15 +199,15 @@ GitLab is a code hosting software and as such you don't want to lose your code w SELinux users are also required to change the security context of the mount point so that it plays nicely with selinux. ```bash -mkdir -p /opt/gitlab/data -sudo chcon -Rt svirt_sandbox_file_t /opt/gitlab/data +mkdir -p /srv/docker/gitlab/gitlab +sudo chcon -Rt svirt_sandbox_file_t /srv/docker/gitlab/gitlab ``` Volumes can be mounted in docker by specifying the **'-v'** option in the docker run command. ```bash docker run --name=gitlab -d \ - -v /opt/gitlab/data:/home/git/data \ + -v /srv/docker/gitlab/gitlab:/home/git/data \ sameersbn/gitlab:7.10.2 ``` @@ -225,11 +225,11 @@ The internal mysql server has been removed from the image. Please use a [linked If you have been using the internal mysql server follow these instructions to migrate to a linked mysql container: -Assuming that your mysql data is available at `/opt/gitlab/mysql` +Assuming that your mysql data is available at `/srv/docker/gitlab/mysql` ```bash docker run --name=mysql -d \ - -v /opt/gitlab/mysql:/var/lib/mysql \ + -v /srv/docker/gitlab/mysql:/var/lib/mysql \ sameersbn/mysql:latest ``` @@ -258,7 +258,7 @@ We are now ready to start the GitLab application. ```bash docker run --name=gitlab -d \ -e 'DB_HOST=192.168.1.100' -e 'DB_NAME=gitlabhq_production' -e 'DB_USER=gitlab' -e 'DB_PASS=password' \ - -v /opt/gitlab/data:/home/git/data \ + -v /srv/docker/gitlab/gitlab:/home/git/data \ sameersbn/gitlab:7.10.2 ``` @@ -281,8 +281,8 @@ For data persistence lets create a store for the mysql and start the container. SELinux users are also required to change the security context of the mount point so that it plays nicely with selinux. ```bash -mkdir -p /opt/mysql/data -sudo chcon -Rt svirt_sandbox_file_t /opt/mysql/data +mkdir -p /srv/docker/gitlab/mysql +sudo chcon -Rt svirt_sandbox_file_t /srv/docker/gitlab/mysql ``` The run command looks like this. @@ -290,7 +290,7 @@ The run command looks like this. ```bash docker run --name=mysql -d \ -e 'DB_NAME=gitlabhq_production' -e 'DB_USER=gitlab' -e 'DB_PASS=password' \ - -v /opt/mysql/data:/var/lib/mysql \ + -v /srv/docker/gitlab/mysql:/var/lib/mysql \ sameersbn/mysql:latest ``` @@ -300,7 +300,7 @@ We are now ready to start the GitLab application. ```bash docker run --name=gitlab -d --link mysql:mysql \ - -v /opt/gitlab/data:/home/git/data \ + -v /srv/docker/gitlab/gitlab:/home/git/data \ sameersbn/gitlab:7.10.2 ``` @@ -329,7 +329,7 @@ We are now ready to start the GitLab application. ```bash docker run --name=gitlab -d \ -e 'DB_TYPE=postgres' -e 'DB_HOST=192.168.1.100' -e 'DB_NAME=gitlabhq_production' -e 'DB_USER=gitlab' -e 'DB_PASS=password' \ - -v /opt/gitlab/data:/home/git/data \ + -v /srv/docker/gitlab/gitlab:/home/git/data \ sameersbn/gitlab:7.10.2 ``` @@ -352,8 +352,8 @@ For data persistence lets create a store for the postgresql and start the contai SELinux users are also required to change the security context of the mount point so that it plays nicely with selinux. ```bash -mkdir -p /opt/postgresql/data -sudo chcon -Rt svirt_sandbox_file_t /opt/postgresql/data +mkdir -p /srv/docker/gitlab/postgresql +sudo chcon -Rt svirt_sandbox_file_t /srv/docker/gitlab/postgresql ``` The run command looks like this. @@ -361,7 +361,7 @@ The run command looks like this. ```bash docker run --name=postgresql -d \ -e 'DB_NAME=gitlabhq_production' -e 'DB_USER=gitlab' -e 'DB_PASS=password' \ - -v /opt/postgresql/data:/var/lib/postgresql \ + -v /srv/docker/gitlab/postgresql:/var/lib/postgresql \ sameersbn/postgresql:latest ``` @@ -371,7 +371,7 @@ We are now ready to start the GitLab application. ```bash docker run --name=gitlab -d --link postgresql:postgresql \ - -v /opt/gitlab/data:/home/git/data \ + -v /srv/docker/gitlab/gitlab:/home/git/data \ sameersbn/gitlab:7.10.2 ``` @@ -435,7 +435,7 @@ Please refer the [Available Configuration Parameters](#available-configuration-p ```bash docker run --name=gitlab -d \ -e 'SMTP_USER=USER@gmail.com' -e 'SMTP_PASS=PASSWORD' \ - -v /opt/gitlab/data:/home/git/data \ + -v /srv/docker/gitlab/gitlab:/home/git/data \ sameersbn/gitlab:7.10.2 ``` @@ -489,14 +489,14 @@ Out of the four files generated above, we need to install the `gitlab.key`, `git The default path that the gitlab application is configured to look for the SSL certificates is at `/home/git/data/certs`, this can however be changed using the `SSL_KEY_PATH`, `SSL_CERTIFICATE_PATH` and `SSL_DHPARAM_PATH` configuration options. -If you remember from above, the `/home/git/data` path is the path of the [data store](#data-store), which means that we have to create a folder named certs inside `/opt/gitlab/data/` and copy the files into it and as a measure of security we will update the permission on the `gitlab.key` file to only be readable by the owner. +If you remember from above, the `/home/git/data` path is the path of the [data store](#data-store), which means that we have to create a folder named certs inside `/srv/docker/gitlab/gitlab/` and copy the files into it and as a measure of security we will update the permission on the `gitlab.key` file to only be readable by the owner. ```bash -mkdir -p /opt/gitlab/data/certs -cp gitlab.key /opt/gitlab/data/certs/ -cp gitlab.crt /opt/gitlab/data/certs/ -cp dhparam.pem /opt/gitlab/data/certs/ -chmod 400 /opt/gitlab/data/certs/gitlab.key +mkdir -p /srv/docker/gitlab/gitlab/certs +cp gitlab.key /srv/docker/gitlab/gitlab/certs/ +cp gitlab.crt /srv/docker/gitlab/gitlab/certs/ +cp dhparam.pem /srv/docker/gitlab/gitlab/certs/ +chmod 400 /srv/docker/gitlab/gitlab/certs/gitlab.key ``` Great! we are now just one step away from having our application secured. @@ -508,7 +508,7 @@ HTTPS support can be enabled by setting the `GITLAB_HTTPS` option to `true`. Add ```bash docker run --name=gitlab -d \ -e 'GITLAB_HTTPS=true' -e 'SSL_SELF_SIGNED=true' \ - -v /opt/gitlab/data:/home/git/data \ + -v /srv/docker/gitlab/gitlab:/home/git/data \ sameersbn/gitlab:7.10.2 ``` @@ -524,7 +524,7 @@ With `GITLAB_HTTPS_HSTS_MAXAGE` you can configure that value. The default value docker run --name=gitlab -d \ -e 'GITLAB_HTTPS=true' -e 'SSL_SELF_SIGNED=true' \ -e 'GITLAB_HTTPS_HSTS_MAXAGE=2592000' - -v /opt/gitlab/data:/home/git/data \ + -v /srv/docker/gitlab/gitlab:/home/git/data \ sameersbn/gitlab:7.10.2 ``` @@ -546,7 +546,7 @@ In summation, when using a load balancer, the docker command would look for the docker run --name=gitlab -d -p 10022:22 -p 10080:80 \ -e 'GITLAB_SSH_PORT=10022' -e 'GITLAB_PORT=443' \ -e 'GITLAB_HTTPS=true' -e 'SSL_SELF_SIGNED=true' \ - -v /opt/gitlab/data:/home/git/data \ + -v /srv/docker/gitlab/gitlab:/home/git/data \ sameersbn/gitlab:7.10.2 ``` @@ -594,7 +594,7 @@ Let's assume we want to deploy our application to '/git'. GitLab needs to know t ```bash docker run --name=gitlab -it --rm \ -e 'GITLAB_RELATIVE_URL_ROOT=/git' \ - -v /opt/gitlab/data:/home/git/data \ + -v /srv/docker/gitlab/gitlab:/home/git/data \ sameersbn/gitlab:7.10.2 ``` @@ -606,8 +606,8 @@ GitLab will now be accessible at the `/git` path, e.g. `http://www.example.com/g ```bash docker run --name=gitlab -d -h git.local.host \ - -v /opt/gitlab/data:/home/git/data \ - -v /opt/gitlab/mysql:/var/lib/mysql \ + -v /srv/docker/gitlab/gitlab:/home/git/data \ + -v /srv/docker/gitlab/mysql:/var/lib/mysql \ -e 'GITLAB_HOST=git.local.host' -e 'GITLAB_EMAIL=gitlab@local.host' \ -e 'SMTP_USER=USER@gmail.com' -e 'SMTP_PASS=PASSWORD' \ sameersbn/gitlab:7.10.2 @@ -617,7 +617,7 @@ If you are using an external mysql database ```bash docker run --name=gitlab -d -h git.local.host \ - -v /opt/gitlab/data:/home/git/data \ + -v /srv/docker/gitlab/gitlab:/home/git/data \ -e 'DB_HOST=192.168.1.100' -e 'DB_NAME=gitlabhq_production' -e 'DB_USER=gitlab' -e 'DB_PASS=password' \ -e 'GITLAB_HOST=git.local.host' -e 'GITLAB_EMAIL=gitlab@local.host' \ -e 'SMTP_USER=USER@gmail.com' -e 'SMTP_PASS=PASSWORD' \