{"id":336500,"date":"2022-08-03T09:00:06","date_gmt":"2022-08-03T09:00:06","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=336500"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=336500","title":{"rendered":"<span>\u0420\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u0435 GitLab CE \u0432 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430\u0445 Docker \u0437\u0430 \u043e\u0431\u0440\u0430\u0442\u043d\u044b\u043c \u043f\u0440\u043e\u043a\u0441\u0438<\/span>"},"content":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-1\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/mv\/dm\/uc\/mvdmucumqynzlrwdpqslduwctds.png\" data-src=\"https:\/\/habrastorage.org\/webt\/mv\/dm\/uc\/mvdmucumqynzlrwdpqslduwctds.png\"\/><br \/>  \u0412 \u044d\u0442\u043e\u043c \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u0435 \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u043a\u0430\u043a \u0431\u044b\u0441\u0442\u0440\u043e \u043f\u043e\u0434\u043d\u044f\u0442\u044c \u0441\u0432\u043e\u0439 GitLab \u0441\u0435\u0440\u0432\u0435\u0440 \u043d\u0430 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430\u0445 Docker, \u043d\u0430\u0445\u043e\u0434\u044f\u0449\u0438\u0439\u0441\u044f \u0437\u0430 \u043e\u0431\u0440\u0430\u0442\u043d\u044b\u043c \u043f\u0440\u043e\u043a\u0441\u0438 \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u043c NGINX. \u041f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u0443 \u0432\u0430\u0441 \u0443\u0436\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d \u0434\u0432\u0438\u0436\u043e\u043a \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 Docker \u0438 Compose, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043e\u0431\u0440\u0430\u0442\u043d\u044b\u0439 \u043f\u0440\u043e\u043a\u0441\u0438 \u0441\u0435\u0440\u0432\u0435\u0440 NGINX.<br \/>  <a name=\"habracut\"><\/a><br \/>  GitLab \u0441\u0435\u0440\u0432\u0435\u0440 \u0431\u0443\u0434\u0435\u0442 \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u043f\u043e \u0430\u0434\u0440\u0435\u0441\u0443: <a href=\"https:\/\/git.example.com\">git.example.com<\/a>. \u0422\u0430\u043a\u0436\u0435 \u043d\u0435 \u0437\u0430\u0431\u044b\u0432\u0430\u0435\u043c \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0410 \u0437\u0430\u043f\u0438\u0441\u044c \u0434\u043b\u044f \u0434\u043e\u043c\u0435\u043d\u0430 git.example.com \u0432 DNS.<\/p>\n<p>  \u0418\u0442\u0430\u043a, \u0434\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u043e\u0432 \u0434\u043b\u044f \u043d\u0430\u0448\u0435\u0433\u043e GitLab:  <\/p>\n<pre><code class=\"bash\">mkdir -p \/opt\/gitlab\/{config,logs,data}<\/code><\/pre>\n<p>  \u0414\u0430\u043b\u0435\u0435 \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u043c \u0444\u0430\u0439\u043b docker-compose.yml \u043a \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c\u0443 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u043c\u0443:  <\/p>\n<pre><code class=\"plaintext\">version: '3.7'   services:   web:     image: 'gitlab\/gitlab-ce:15.2.0-ce.0'     restart: always     hostname: 'git.example.com'     environment:       GITLAB_OMNIBUS_CONFIG: |         external_url 'https:\/\/git.example.com'         gitlab_rails['gitlab_shell_ssh_port'] = 2224     ports:       - '127.0.0.1:8080:80'       - '2224:22'     volumes:       - '.\/config:\/etc\/gitlab'       - '.\/logs:\/var\/log\/gitlab'       - '.\/data:\/var\/opt\/gitlab'     shm_size: '256m' <\/code><\/pre>\n<p>  \u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043e\u0431\u0440\u0430\u0437\u0430 \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u044e\u044e \u0432\u0435\u0440\u0441\u0438\u044e GitLab Community Edition 15.2.0 (\u043d\u0430 \u043c\u043e\u043c\u0435\u043d\u0442 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0441\u0442\u0430\u0442\u044c\u0438), \u0432\u0435\u0448\u0430\u0435\u043c GitLab \u043d\u0430 loopback \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441, \u0430 \u0434\u043b\u044f ssh \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u043d\u0435\u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 \u043f\u043e\u0440\u0442 2224.<\/p>\n<p>  \u0412\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u0431\u0438\u043b\u0434 \u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u044b:  <\/p>\n<pre><code class=\"bash\">docker compose -f \/opt\/gitlab\/docker-compose.yml up -d \u2013build<\/code><\/pre>\n<p>  \u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u0441\u0442\u0430\u0442\u0443\u0441 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u043e\u0432:  <\/p>\n<pre><code class=\"bash\">docker ps<\/code><\/pre>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043e\u0442\u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u043a\u043e\u043d\u0444\u0438\u0433 \u0444\u0430\u0439\u043b GitLab \u0438 \u0440\u0430\u0441\u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b:<br \/>  vi \/opt\/gitlab\/config\/gitlab.rb  <\/p>\n<pre><code class=\"ruby\">gitlab_rails['smtp_enable'] = true gitlab_rails['smtp_address'] = \"mail.example.com\" gitlab_rails['smtp_port'] = 587 gitlab_rails['smtp_user_name'] = \"git@example.com\" gitlab_rails['smtp_password'] = \"password\" gitlab_rails['smtp_domain'] = \"example.com\" gitlab_rails['gitlab_email_from'] = 'git@example.com' gitlab_rails['gitlab_email_display_name'] = 'GitLab' nginx['listen_port'] = 80 nginx['listen_https'] = false nginx['proxy_set_headers'] = {   \"Host\" => \"git.example.com\",   \"X-Real-IP\" => \"$remote_addr\",   \"X-Forwarded-For\" => \"$proxy_add_x_forwarded_for\",   \"X-Forwarded-Proto\" => \"https\",   \"X-Forwarded-Ssl\" => \"on\",   \"Upgrade\" => \"$http_upgrade\",   \"Connection\" => \"$connection_upgrade\" }<\/code><\/pre>\n<p>  \u041c\u044b \u0440\u0430\u0437\u0440\u0435\u0448\u0438\u043b\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0443 \u043f\u0438\u0441\u0435\u043c \u0447\u0435\u0440\u0435\u0437 SMTP, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0443\u043a\u0430\u0437\u0430\u043b\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b nginx \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0437\u0430 \u043e\u0431\u0440\u0430\u0442\u043d\u044b\u043c \u043f\u0440\u043e\u043a\u0441\u0438. \u0414\u043b\u044f \u0432\u0441\u0442\u0443\u043f\u043b\u0435\u043d\u0438\u044f \u0432 \u0441\u0438\u043b\u0443 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439, \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u044b:  <\/p>\n<pre><code class=\"bash\">docker compose -f \/opt\/gitlab\/docker-compose.yml restart<\/code><\/pre>\n<p>  \u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043a\u043e\u043d\u0444\u0438\u0433 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0445\u043e\u0441\u0442\u0430 \u043d\u0430 \u0441\u0442\u043e\u0440\u043e\u043d\u0435 \u043e\u0431\u0440\u0430\u0442\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u043a\u0441\u0438 NGINX:  <\/p>\n<pre><code class=\"nginx\">server {     listen       80;     server_name  git.example.com;       location \/ {         proxy_set_header        Host $host;         proxy_set_header        X-Real-IP $remote_addr;         proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for;         proxy_set_header        X-Forwarded-Proto $scheme;           proxy_pass                  http:\/\/localhost:8080;         proxy_read_timeout     90;     }       error_log   \/var\/log\/nginx\/git_example_com_error.log error;     access_log  \/var\/log\/nginx\/git_example_com_access.log; }<\/code><\/pre>\n<p>  \u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u0438 \u043f\u0435\u0440\u0435\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c \u043a\u043e\u043d\u0444\u0438\u0433:  <\/p>\n<pre><code class=\"bash\">nginx -t nginx -s reload<\/code><\/pre>\n<p>  \u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043f\u0430\u043a\u0435\u0442\u0430 certbot \u0438 python3-certbot-nginx \u043c\u043e\u0436\u0435\u043c \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c SSL \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442 \u043e\u0442 Let\u2019s Encrypt:  <\/p>\n<pre><code class=\"bash\">certbot --nginx -d git.example.com nginx -t nginx -s reload<\/code><\/pre>\n<p>  \u041e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u043c \u0441\u0430\u0439\u0442 git.example.com \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435 \u0438 \u043f\u044b\u0442\u0430\u0435\u043c\u0441\u044f \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f. \u041f\u0430\u0440\u043e\u043b\u044c \u043e\u0442 root \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435:  <\/p>\n<pre><code class=\"bash\">docker exec -it gitlab-web-1 grep 'Password:' \/etc\/gitlab\/initial_root_password<\/code><\/pre>\n<p>  \u0418\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0438:<br \/>  <a href=\"https:\/\/docs.gitlab.com\/ee\/install\/docker.html\">docs.gitlab.com\/ee\/install\/docker.html<\/a> <br \/>  <a href=\"https:\/\/www.czerniga.it\/2021\/11\/14\/how-to-install-gitlab-using-docker-compose\/\">www.czerniga.it\/2021\/11\/14\/how-to-install-gitlab-using-docker-compose<\/a><\/div>\n<\/div>\n<\/div>\n<div class=\"v-portal\" style=\"display:none;\"><\/div>\n<\/div>\n<p> <!----> <!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/company\/timeweb\/blog\/680594\/\"> https:\/\/habr.com\/ru\/company\/timeweb\/blog\/680594\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-1\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/mv\/dm\/uc\/mvdmucumqynzlrwdpqslduwctds.png\" data-src=\"https:\/\/habrastorage.org\/webt\/mv\/dm\/uc\/mvdmucumqynzlrwdpqslduwctds.png\"\/><br \/>  \u0412 \u044d\u0442\u043e\u043c \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u0435 \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u043a\u0430\u043a \u0431\u044b\u0441\u0442\u0440\u043e \u043f\u043e\u0434\u043d\u044f\u0442\u044c \u0441\u0432\u043e\u0439 GitLab \u0441\u0435\u0440\u0432\u0435\u0440 \u043d\u0430 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430\u0445 Docker, \u043d\u0430\u0445\u043e\u0434\u044f\u0449\u0438\u0439\u0441\u044f \u0437\u0430 \u043e\u0431\u0440\u0430\u0442\u043d\u044b\u043c \u043f\u0440\u043e\u043a\u0441\u0438 \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u043c NGINX. \u041f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u0443 \u0432\u0430\u0441 \u0443\u0436\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d \u0434\u0432\u0438\u0436\u043e\u043a \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 Docker \u0438 Compose, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043e\u0431\u0440\u0430\u0442\u043d\u044b\u0439 \u043f\u0440\u043e\u043a\u0441\u0438 \u0441\u0435\u0440\u0432\u0435\u0440 NGINX.  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-336500","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/336500","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=336500"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/336500\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=336500"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=336500"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=336500"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}