{"id":290286,"date":"2018-10-03T23:35:02","date_gmt":"2018-10-03T19:35:02","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=290286"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=290286","title":{"rendered":"\u0415\u0449\u0435 \u043e\u0434\u0438\u043d \u0441\u043f\u043e\u0441\u043e\u0431 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f docker-compose"},"content":{"rendered":"\n<div class=\"post__text post__text-html js-mediator-article\">\n<p>\u041f\u043e \u0441\u043b\u0435\u0434\u0430\u043c \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/post\/425101\/\">Docker + Laravel = ?<\/a> \u0445\u043e\u0447\u0443 \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u0442\u044c \u043e \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043d\u0435\u043e\u0431\u044b\u0447\u043d\u043e\u043c \u0441\u043f\u043e\u0441\u043e\u0431\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0443\u0442\u0438\u043b\u0438\u0442\u044b docker-compose.<\/p>\n<p>  <\/p>\n<p>\u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430, \u0434\u043b\u044f \u0442\u0435\u0445 \u043a\u0442\u043e \u043d\u0435 \u0437\u043d\u0430\u0435\u0442, \u0437\u0430\u0447\u0435\u043c \u043d\u0443\u0436\u0435\u043d docker-compose. \u042d\u0442\u043e \u0443\u0442\u0438\u043b\u0438\u0442\u0430, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u043d\u0430 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u043c \u0445\u043e\u0441\u0442\u0435 \u043d\u0430\u0431\u043e\u0440 \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0445 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432, \u0437\u0430\u043f\u0430\u043a\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0432 docker-\u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u044b. \u0418\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f \u0431\u044b\u043b\u0430 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0430 \u043d\u0430 python \u0438 \u043c\u043e\u0433\u043b\u0430 \u0431\u044b\u0442\u044c \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u0430 \u0434\u0432\u0443\u043c\u044f \u0441\u043f\u043e\u0441\u043e\u0431\u0430\u043c\u0438:<\/p>\n<p><a name=\"habracut\"><\/a>  <\/p>\n<ul>\n<li>\u0447\u0435\u0440\u0435\u0437 \u043f\u0430\u043a\u0435\u0442\u043d\u044b\u0439 \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b (<code>apt install docker-compose<\/code> \u0434\u043b\u044f Ubuntu \u0438 <code>yum install docker-compose.noarch<\/code> \u0434\u043b\u044f Centos)<\/li>\n<li>\u0447\u0435\u0440\u0435\u0437 \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 python (<code>pip install docker-compose<\/code>)<\/li>\n<\/ul>\n<p>  <\/p>\n<p>\u041f\u0440\u043e\u0431\u043b\u0435\u043c\u043e\u0439 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0441\u043f\u043e\u0441\u043e\u0431\u0430 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0442\u043e, \u0447\u0442\u043e \u043e\u0431\u044b\u0447\u043d\u043e \u0432 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f\u0445 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b docker-compose \u0441\u0442\u0430\u0440\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438. \u042d\u0442\u043e \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u043e\u0439, \u0435\u0441\u043b\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u0432\u0435\u0436\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e \u0434\u0435\u043c\u043e\u043d\u0430 docker \u0438\u043b\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0434\u043b\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 \u0444\u043e\u0440\u043c\u0430\u0442\u0430 \u0444\u0430\u0439\u043b\u0430 docker-compose.yaml \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 (\u043c\u0430\u0442\u0440\u0438\u0446\u0443 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u043c\u044b\u0445 \u0444\u0438\u0447 \u043f\u043e \u0432\u0435\u0440\u0441\u0438\u044f\u043c \u0444\u043e\u0440\u043c\u0430\u0442\u0430 \u0438 \u0432\u0435\u0440\u0441\u0438\u044f\u043c \u0443\u0442\u0438\u043b\u0438\u0442\u044b docker-compose \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u043d\u0430 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u043c \u0441\u0430\u0439\u0442\u0435 docker).<\/p>\n<p>  <\/p>\n<p>\u0421\u0435\u0439\u0447\u0430\u0441 \u0436\u0435 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 docker \u043f\u0435\u0440\u0435\u043f\u0438\u0441\u0430\u043b\u0438 \u0443\u0442\u0438\u043b\u0438\u0442\u0443 \u043d\u0430 go \u0438 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u0435\u0435 \u0432 \u0432\u0438\u0434\u0435 \u0431\u0438\u043d\u0430\u0440\u043d\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430, \u0447\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0435\u0435 \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u043c (\u044d\u0442\u043e \u0442\u0435\u043a\u0443\u0449\u0438\u0439 \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u0435\u043c\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431):<\/p>\n<p>  <\/p>\n<ol>\n<li>\n<p>\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u044e\u044e \u0432\u0435\u0440\u0441\u0438\u044e \u043d\u0430 <a href=\"https:\/\/github.com\/docker\/compose\/releases\">https:\/\/github.com\/docker\/compose\/releases<\/a> \u0438 \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u0435\u043c \u0435\u0435<\/p>\n<p>  <\/p>\n<pre><code>$ sudo curl -L \"https:\/\/github.com\/docker\/compose\/releases\/download\/1.22.0\/docker-compose-$(uname -s)-$(uname -m)\" -o \/usr\/local\/bin\/docker-compose<\/code><\/pre>\n<p>  <\/li>\n<li>\n<p>\u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u043f\u0440\u0430\u0432\u0430 \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f<\/p>\n<p>  <\/p>\n<pre><code>$ sudo chmod +x \/usr\/local\/bin\/docker-compose<\/code><\/pre>\n<p>  <\/li>\n<li>\n<p>\u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043c\u043e\u0436\u043d\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c <a href=\"https:\/\/docs.docker.com\/compose\/completion\/\">\u0430\u0432\u0442\u043e\u0434\u043e\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435<\/a> \u0434\u043b\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u044b\u0445 \u0438\u043d\u0442\u0435\u043f\u0440\u0435\u0442\u0430\u0442\u043e\u0440\u043e\u0432 bash \u0438 zsh<\/p>\n<p>  <\/li>\n<li>\n<p>\u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0443<\/p>\n<p>  <\/p>\n<pre><code>$ docker-compose --version docker-compose version 1.22.0, build 1719ceb<\/code><\/pre>\n<p>  <\/li>\n<\/ol>\n<p>  <\/p>\n<p>\u042f \u0441\u0447\u0438\u0442\u0430\u044e, \u0447\u0442\u043e \u0435\u0434\u0438\u043d\u044b\u0439 \u0431\u0438\u043d\u0430\u0440\u043d\u0438\u043a \u044d\u0442\u043e \u043e\u0447\u0435\u043d\u044c \u0437\u0434\u043e\u0440\u043e\u0432\u043e, \u0442.\u043a. \u043d\u0430\u043c \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u0442\u044f\u043d\u0443\u0442\u044c \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 python. \u0414\u0430, \u0438 \u0432\u043e\u043e\u0431\u0449\u0435 \u2014 \u043c\u043e\u0436\u0435\u0442 \u0443 \u043d\u0430\u0441 python \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0435 \u0441\u043e\u0432\u0441\u0435\u043c \u0441\u043b\u043e\u043c\u0430\u043d\u043e \u043d\u0430 \u0446\u0435\u043b\u0435\u0432\u043e\u0439 \u043c\u0430\u0448\u0438\u043d\u0435, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c!!! <\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/1t\/bj\/hm\/1tbjhmezttp2dgxb_wtiariskfm.png\"><br \/>  <em>\u041f\u0440\u0438\u043c\u0435\u0440 \u043f\u0443\u0442\u0430\u043d\u0438\u0446\u044b \u0432 python-\u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0438<\/em><\/p>\n<p>  <\/p>\n<p>\u041d\u043e \u0435\u0441\u0442\u044c \u0435\u0449\u0435 4-\u0439 \u043f\u0443\u0442\u044c, \u043e \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u044f \u0438 \u0445\u043e\u0442\u0435\u043b \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u0442\u044c. \u042d\u0442\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c docker-compose \u0447\u0435\u0440\u0435\u0437 docker. \u0414\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e, \u0435\u0441\u0442\u044c \u0443\u0436\u0435 \u0441\u043e\u0431\u0440\u0430\u043d\u043d\u044b\u0435 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0435 \u043e\u0431\u0440\u0430\u0437\u044b \u043d\u0430 Docker Hub (<a href=\"https:\/\/hub.docker.com\/r\/docker\/compose\/\">https:\/\/hub.docker.com\/r\/docker\/compose\/<\/a>). \u0417\u0430\u0447\u0435\u043c \u043e\u043d\u0438 \u043c\u043e\u0433\u0443\u0442 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u044c\u0441\u044f?<\/p>\n<p>  <\/p>\n<ul>\n<li>\u0435\u0441\u043b\u0438 \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u043c\u0438 \u0432\u0435\u0440\u0441\u0438\u044f\u043c\u0438 docker-compose \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e (\u0445\u043e\u0442\u044f \u043e\u0431\u044b\u0447\u043d\u043e \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0439 \u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u043e\u0439)<\/li>\n<li>\u0435\u0441\u043b\u0438 \u0443 \u043d\u0430\u0441 \u043d\u0435\u0442 python \u0438\u043b\u0438 \u043c\u044b \u043d\u0435 \u0445\u043e\u0442\u0438\u043c \u0435\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0443 \u043d\u0430\u0441 \u043e\u0431\u043b\u0435\u0433\u0447\u0435\u043d\u043d\u044b\u0439 \u0434\u0438\u0441\u0442\u0440\u0438\u0431\u0443\u0442\u0438\u0432 <a href=\"https:\/\/coreos.com\/os\/docs\/latest\/\">CoreOS Container Linux<\/a>)<\/li>\n<li>\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0432 CI\/CD \u043f\u0430\u0439\u043f\u043b\u0430\u0439\u043d\u0430\u0445.<\/li>\n<\/ul>\n<p>  <\/p>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c!<\/p>\n<p>  <\/p>\n<p>\u041a\u0430\u043a \u043c\u044b \u0434\u0435\u043b\u0430\u043b\u0438 \u043e\u0431\u044b\u0447\u043d\u043e \u0437\u0430\u043f\u0443\u0441\u043a \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u043e\u0432:<\/p>\n<p>  <\/p>\n<pre><code>$ docker-compose up -d <\/code><\/pre>\n<p>  <\/p>\n<p>\u0427\u0435\u0440\u0435\u0437 \u0443\u0442\u0438\u043b\u0438\u0442\u0443, \u0437\u0430\u043f\u0430\u043a\u043e\u0432\u0430\u043d\u043d\u0443\u044e \u0432 docker-\u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440:<\/p>\n<p>  <\/p>\n<pre><code>$ docker run --rm -v \/var\/run\/docker.sock:\/var\/run\/docker.sock -v \"$PWD:\/rootfs\/$PWD\" -w=\"\/rootfs\/$PWD\" docker\/compose:1.13.0 up -d<\/code><\/pre>\n<p>  <\/p>\n<p>\u0421\u043b\u0438\u0448\u043a\u043e\u043c \u043c\u043d\u043e\u0433\u043e\u0441\u043b\u043e\u0432\u043d\u043e, \u0434\u0430? \u041c\u043e\u0437\u0433 \u043c\u043e\u0436\u043d\u043e \u0441\u043b\u043e\u043c\u0430\u0442\u044c \u0437\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u0442\u044c \u0432\u0441\u0435 \u044d\u0442\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u043e\u0431\u043b\u0435\u0433\u0447\u0438\u0442\u044c \u0441\u0435\u0431\u0435 \u0436\u0438\u0437\u043d\u044c \u0438 \u043d\u0430\u043f\u0438\u0448\u0435\u043c \u043e\u0431\u0435\u0440\u0442\u043a\u0443 (wrapper) \u043d\u0430 \u044f\u0437\u044b\u043a\u0435 \u043e\u0431\u043e\u043b\u043e\u0447\u043a\u0438. \u041d\u043e \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u0440\u0430\u0437\u0431\u0435\u0440\u0435\u043c\u0441\u044f \u0432 \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0435\u043c\u044b\u0445 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u0445:<\/p>\n<p>  <\/p>\n<ul>\n<li><code>--rm<\/code> \u2014 \u0443\u0434\u0430\u043b\u044f\u0435\u0442 \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0439 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 \u043f\u043e\u0441\u043b\u0435 \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438, \u0442.\u0435. \u043c\u044b \u043d\u0435 \u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c \u043c\u0443\u0441\u043e\u0440\u0430 \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0435<\/li>\n<li><code>-v \/var\/run\/docker.sock:\/var\/run\/docker.sock<\/code> \u2014 \u0431\u0435\u0437 \u044d\u0442\u043e\u0433\u043e docker-compose \u043d\u0435 \u0441\u043c\u043e\u0436\u0435\u0442 \u0441\u043e\u0435\u0434\u0438\u043d\u0438\u0442\u044c\u0441\u044f \u0441 docker-\u0434\u0435\u043c\u043e\u043d\u043e\u043c \u043d\u0430 \u0445\u043e\u0441\u0442\u0435<\/li>\n<li><code>-v \"$PWD:\/rootfs\/$PWD\" -w=\"\/rootfs\/$PWD\"<\/code> \u2014 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u0440\u043e\u0431\u0440\u043e\u0441\u0438\u0442\u044c \u0442\u0435\u043a\u0443\u0449\u0438\u0439 \u043a\u0430\u0442\u0430\u043b\u043e\u0433 \u0432\u043d\u0443\u0442\u0440\u044c \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430, \u0447\u0442\u043e\u0431\u044b \u0443\u0442\u0438\u043b\u0438\u0442\u0430 \u0443\u0432\u0438\u0434\u0435\u043b\u0430 docker-compose \u0444\u0430\u0439\u043b<\/li>\n<\/ul>\n<p>  <\/p>\n<p>\u041d\u0430\u043c \u0435\u0449\u0435 \u043d\u0435 \u0445\u0432\u0430\u0442\u0430\u0435\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0438\u043d\u0442\u0435\u0440\u043f\u043e\u043b\u044f\u0446\u0438\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0432 docker-compose \u0444\u0430\u0439\u043b\u0435. \u042d\u0442\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441, \u043f\u0440\u0438 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0443\u0442\u0438\u043b\u0438\u0442\u0430 \u043f\u043e\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f \u0432 YAML-\u0444\u0430\u0439\u043b. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432\u043e \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u0435 <\/p>\n<p>  <\/p>\n<pre><code>version: \"2.1\" services:   pg:     image: postgres:9.6     environment:       POSTGRES_USER: ${POSTGRES_DB_USER}       POSTGRES_PASSWORD: ${POSTGRES_DB_PASSWORD}<\/code><\/pre>\n<p>  <\/p>\n<p>\u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 <code>POSTGRES_DB_USER<\/code> \u0438 <code>POSTGRES_DB_PASSWORD<\/code> \u0431\u0443\u0434\u0443\u0442 \u0441\u0447\u0438\u0442\u0430\u043d\u044b \u0438\u0437 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f. \u042d\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0441 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0439 \u0441\u0442\u0435\u043f\u0435\u043d\u044c\u044e \u0443\u0434\u043e\u0431\u043d\u043e\u0441\u0442\u0438 \u0448\u0430\u0431\u043b\u043e\u043d\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c docker-compose \u0444\u0430\u0439\u043b\u044b. \u0422.\u0435. \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0437\u0430\u0445\u0432\u0430\u0442\u0438\u0442\u044c \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0435 \u0441 \u0445\u043e\u0441\u0442-\u043c\u0430\u0448\u0438\u043d\u044b \u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u0432\u043d\u0443\u0442\u0440\u044c \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430. <\/p>\n<p>  <\/p>\n<p>\u0420\u0435\u0448\u0438\u043c \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0435\u043c bash-\u0441\u043a\u0440\u0438\u043f\u0442\u0430.<\/p>\n<p>  <\/p>\n<pre><code>#!\/bin\/sh # \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0439 \u0444\u0430\u0439\u043b \u0441 \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u043c \u0438\u043c\u0435\u043d\u0435\u043c TMPFILE=$(mktemp) # \u0437\u0430\u0445\u0432\u0430\u0442\u0438\u043c \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0435 \u0438 \u0437\u0430\u043f\u0438\u0448\u0435\u043c \u0432 \u0444\u0430\u0439\u043b env &gt; \"${TMPFILE}\" # \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u043c \u0432\u0435\u0440\u0441\u0438\u044e \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u0443\u044e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e \u0434\u043b\u044f \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u0430 VERSION=\"1.13.0\" # \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043c docker-compose docker run \\   --rm  \\   -e PWD=\"$PWD\" \\   --env-file \"${TMPFILE}\"  \\   -v \/var\/run\/docker.sock:\/var\/run\/docker.sock \\   -v \"$PWD:\/rootfs\/$PWD\" \\   -w=\"\/rootfs\/$PWD\" \\   docker\/compose:\"${VERSION}\" \\   \"$@\"  # \u0443\u0434\u0430\u043b\u044f\u0435\u043c \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0439 \u0444\u0430\u0439\u043b \u0441 \u0437\u0430\u0445\u0432\u0430\u0447\u0435\u043d\u043d\u044b\u043c \u0441\u043f\u0438\u0441\u043a\u043e\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f rm \"{$TMPFILE}\"<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u043e\u044f\u0432\u0438\u043b\u0438\u0441\u044c \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0441\u0442\u0440\u043e\u0447\u043a\u0438:<\/p>\n<p>  <\/p>\n<ul>\n<li><code>-e PWD=\"$PWD\"<\/code> \u2014 \u043d\u0430 \u0432\u0441\u044f\u043a\u0438\u0439 \u0441\u043b\u0443\u0447\u0430\u0439 \u043f\u0440\u043e\u0431\u0440\u043e\u0441\u0438\u043c \u0442\u0435\u043a\u0443\u0449\u0438\u0439 \u043a\u0430\u0442\u0430\u043b\u043e\u0433<\/li>\n<li><code>--env-file \"${TMPFILE}\"<\/code> \u2014 \u0437\u0434\u0435\u0441\u044c \u043f\u0435\u0440\u0435\u0434\u0430\u044e\u0442\u0441\u044f \u0432\u0441\u0435 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f \u0441 \u0445\u043e\u0441\u0442-\u043c\u0430\u0448\u0438\u043d\u044b<\/li>\n<li><code>docker\/compose:\"${VERSION}\"<\/code> \u2014 \u0438\u043c\u044f \u043e\u0431\u0440\u0430\u0437\u0430, \u0432\u0435\u0440\u0441\u0438\u044e \u0432\u043e\u0437\u044c\u043c\u0435\u043c \u0438\u0437 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439<\/li>\n<li><code>\"$@\"<\/code> \u2014 \u044d\u0442\u0430 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u043a\u0440\u0438\u043f\u0442 \u043a\u0430\u043a \u0431\u0443\u0434\u0442\u043e \u043e\u043d \u0438 \u0435\u0441\u0442\u044c \u0443\u0442\u0438\u043b\u0438\u0442\u0430 docker-compose, \u0442.\u0435. &#171;\u043f\u0440\u043e\u0437\u0440\u0430\u0447\u043d\u043e&#187; \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u0442 \u0441\u0432\u043e\u0438 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b \u0432 docker-\u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440.<\/li>\n<\/ul>\n<p>  <\/p>\n<p>\u0421\u043a\u0440\u0438\u043f\u0442 \u043c\u043e\u0436\u0435\u043c \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432 <code>\/usr\/local\/bin\/docker-compose<\/code>, \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u043d\u0430 \u043d\u0435\u0433\u043e \u0444\u043b\u0430\u0433 eXecute \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c. \u041f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u044b\u0439 \u0441\u043a\u0440\u0438\u043f\u0442 \u043d\u0435 \u043f\u0440\u0435\u0442\u0435\u043d\u0434\u0443\u0435\u0442 \u043d\u0430 100% \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 \u043e\u0448\u0438\u0431\u043e\u043a \u0438\u043b\u0438 \u043d\u0435\u0434\u043e\u0440\u0430\u0431\u043e\u0442\u043e\u043a \u0438 \u0441\u043a\u043e\u0440\u0435\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0438\u043b\u043b\u044e\u0441\u0442\u0440\u0430\u0446\u0438\u0435\u0439 \u043c\u0435\u0442\u043e\u0434\u0430. <\/p>\n<p>  <\/p>\n<p>\u0421\u0430\u043c\u0438 \u043c\u044b \u0442\u0430\u043a\u0438\u043c \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u043c \u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f \u0432 CI\/CD \u043f\u0430\u0439\u043f\u043b\u0430\u0439\u043d\u0430\u0445. \u042d\u0442\u043e \u0434\u0430\u0436\u0435 \u0434\u043e \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0441\u0442\u0435\u043f\u0435\u043d\u0438 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u044d\u043a\u043e\u043d\u043e\u043c\u0438\u0442\u044c \u0442\u0440\u0430\u0444\u0438\u043a, \u0442.\u043a. \u0446\u0435\u043b\u0435\u0432\u043e\u0439 \u043e\u0431\u0440\u0430\u0437 docker \u0431\u0435\u0440\u0435\u0442\u0441\u044f \u0438\u0437 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043a\u044d\u0448\u0430.<\/p>\n<\/div>\n<p>        <script class=\"js-mediator-script\">!function(e){function t(t,n){if(!(n in e)){for(var r,a=e.document,i=a.scripts,o=i.length;o--;)if(-1!==i[o].src.indexOf(t)){r=i[o];break}if(!r){r=a.createElement(\"script\"),r.type=\"text\/javascript\",r.async=!0,r.defer=!0,r.src=t,r.charset=\"UTF-8\";var d=function(){var e=a.getElementsByTagName(\"script\")[0];e.parentNode.insertBefore(r,e)};\"[object Opera]\"==e.opera?a.addEventListener?a.addEventListener(\"DOMContentLoaded\",d,!1):e.attachEvent(\"onload\",d):d()}}}t(\"\/\/mediator.mail.ru\/script\/2820404\/\",\"_mediator\")}(window);<\/script>     <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\/post\/425273\/\"> https:\/\/habr.com\/post\/425273\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html js-mediator-article\">\n<p>\u041f\u043e \u0441\u043b\u0435\u0434\u0430\u043c \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/post\/425101\/\">Docker + Laravel = ?<\/a> \u0445\u043e\u0447\u0443 \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u0442\u044c \u043e \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043d\u0435\u043e\u0431\u044b\u0447\u043d\u043e\u043c \u0441\u043f\u043e\u0441\u043e\u0431\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0443\u0442\u0438\u043b\u0438\u0442\u044b docker-compose.<\/p>\n<p>  <\/p>\n<p>\u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430, \u0434\u043b\u044f \u0442\u0435\u0445 \u043a\u0442\u043e \u043d\u0435 \u0437\u043d\u0430\u0435\u0442, \u0437\u0430\u0447\u0435\u043c \u043d\u0443\u0436\u0435\u043d docker-compose. \u042d\u0442\u043e \u0443\u0442\u0438\u043b\u0438\u0442\u0430, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u043d\u0430 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u043c \u0445\u043e\u0441\u0442\u0435 \u043d\u0430\u0431\u043e\u0440 \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0445 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432, \u0437\u0430\u043f\u0430\u043a\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0432 docker-\u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u044b. \u0418\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f \u0431\u044b\u043b\u0430 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0430 \u043d\u0430 python \u0438 \u043c\u043e\u0433\u043b\u0430 \u0431\u044b\u0442\u044c \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u0430 \u0434\u0432\u0443\u043c\u044f \u0441\u043f\u043e\u0441\u043e\u0431\u0430\u043c\u0438:<\/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-290286","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/290286","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=290286"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/290286\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=290286"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=290286"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=290286"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}