{"id":1561,"date":"2025-04-01T05:13:26","date_gmt":"2025-04-01T03:13:26","guid":{"rendered":"https:\/\/olvas.dev\/?p=1561"},"modified":"2025-04-01T05:13:26","modified_gmt":"2025-04-01T03:13:26","slug":"%d0%bd%d0%b0%d1%81%d1%82%d1%80%d0%be%d0%b9%d0%ba%d0%b0-postgresql-%d0%bd%d0%b0-vps-%d0%b4%d0%bb%d1%8f-%d0%b4%d0%be%d1%81%d1%82%d1%83%d0%bf%d0%b0-%d0%b8%d0%b7-docker-%d0%ba%d0%be%d0%bd%d1%82%d0%b5","status":"publish","type":"post","link":"https:\/\/olvas.dev\/?p=1561","title":{"rendered":"\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 PostgreSQL \u043d\u0430 VPS \u0434\u043b\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u0438\u0437 Docker \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430"},"content":{"rendered":"\n<p>\u0412\u0441\u0435\u043c \u043f\u0440\u0438\u0432\u0435\u0442, \u0441\u0435\u0433\u043e\u0434\u043d\u044f \u044f \u0445\u043e\u0447\u0443 \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u0442\u044c \u0432\u0430\u043c \u043e \u0441\u0432\u043e\u0435\u043c \u043e\u043f\u044b\u0442\u0435 \u043f\u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 PostgreSQL \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435 \u0438 \u043a\u0430\u043a\u0438\u0435 \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0432\u043e\u0437\u043d\u0438\u043a\u043b\u0438 \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u0438, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043e \u0442\u043e\u043c \u043a\u0430\u043a \u0432\u0441\u0435 \u044d\u0442\u043e \u0440\u0435\u0448\u0438\u043b\u043e\u0441\u044c.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">\u0410 \u0441 \u043a\u0430\u043a\u043e\u0439 \u0446\u0435\u043b\u044c\u044e?<\/h4>\n\n\n\n<p>\u041f\u0440\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u043d\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u043c\u044b \u0434\u043e\u0448\u043b\u0438 \u0434\u043e \u0442\u043e\u0433\u043e \u044d\u0442\u0430\u043f\u0430, \u043a\u043e\u0433\u0434\u0430 \u0431\u0430\u0437\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 Docker-\u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0435 \u0443\u0436\u0435 \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u043d\u0435\u043d\u0430\u0434\u0435\u0436\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438, \u043d\u043e \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u043f\u0440\u043e\u0435\u043a\u0442 \u0435\u0449\u0435 \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0440\u0430\u0437\u0440\u043e\u0441\u0441\u044f, \u0447\u0442\u043e\u0431\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c K8s \u0438 \u0435\u0433\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">\u0427\u0442\u043e \u0431\u044b\u043b\u043e \u0441\u043d\u0430\u0447\u0430\u043b\u0430<\/h4>\n\n\n\n<p>\u0418\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u0430\u044f \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>services:<br>\tbackend:<br>\t\timage: application:latest<br>\t\tports:<br>\t\t\t- \"127.0.0.1:8000:8000\"<br>\t\tenv_file:<br>\t\t\t- ..\/..\/.env<br>\t\tlinks:<br>\t\t\t- \"postgres:db\"<br>\t\tdepends_on:<br>\t\t\t- postgres<br>\t\tvolumes:<br>\t\t\t- ..\/..\/:\/app<br>\tpostgres:<br>\t\timage: postgres:17.2-alpine3.21<br>\t\tenv_file:<br>\t\t\t- ..\/..\/.env<br>\t\tvolumes:<br>\t\t\t- postgres:\/var\/lib\/postgresql\/data<br>\t\thealthcheck:<br>\t\t  test: &#91; \"CMD-SHELL\", \"POSTGRES_PASSWORD=postgres pg_isready -U postgres\" ]<br>\t\t  retries: 10<br>\t\t  interval: 5s<br>\t\t  timeout: 5s<br>volumes:<br>\tpostgres:<\/code><\/pre>\n\n\n\n<p>\u0412 \u043d\u0430\u0448\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0434\u043b\u044f \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043a \u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u043e\u043f\u0430\u0434\u0430\u044e\u0442 \u0438\u0437 .env \u0444\u0430\u0439\u043b\u0430 \u0438 \u0432\u044b\u0433\u043b\u044f\u0434\u044f\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>POSTGRES_DB=postgres<br>POSTGRES_USER=postgres<br>POSTGRES_PASSWORD=postgres<br>POSTGRES_PORT=5432<br>POSTGRES_HOST=db<\/code><\/pre>\n\n\n\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u0432\u044b\u043d\u0435\u0441\u0435\u043c \u0431\u0430\u0437\u0443 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c \u0435\u0451 \u043d\u0430 \u043c\u0430\u0448\u0438\u043d\u0443. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt install postgresql<\/code><\/pre>\n\n\n\n<p>\u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c, \u043e\u0442\u043a\u0443\u0434\u0430 \u043c\u043e\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u0432 \u0444\u0430\u0439\u043b \/etc\/postgresql\/*\/main\/postgresql.conf. \u041c\u0435\u043d\u044f\u0435\u043c \u0441\u0442\u0440\u043e\u043a\u0443&nbsp;<a href=\"https:\/\/www.postgresql.org\/docs\/current\/runtime-config-connection.html\" rel=\"noreferrer noopener\" target=\"_blank\">listen_addresses<\/a>&nbsp;\u0438 \u0443\u0431\u0438\u0440\u0430\u0435\u043c \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0439 \u0441 \u043d\u0435\u0451<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>listen_addresses = '*'<\/code><\/pre>\n\n\n\n<p>\u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u0437\u0430\u0445\u043e\u0434\u0438\u043c \u0432 \u0434\u0435\u0444\u043e\u043b\u0442\u043d\u0443\u044e \u0431\u0430\u0437\u0443 \u0434\u0430\u043d\u043d\u044b\u0445 template1 \u0434\u043b\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0438 \u043c\u0435\u043d\u044f\u0435\u043c \u043f\u0430\u0440\u043e\u043b\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f postgres:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo -u postgres psql template1<br>ALTER USER postgres with encrypted password 'your_password';<\/code><\/pre>\n\n\n\n<p>\u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u0434\u043b\u044f \u0432\u0445\u043e\u0434\u0430 \u043f\u043e\u0434 \u044d\u0442\u0438\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u043c \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0432\u0432\u043e\u0434\u0438\u0442\u044c \u043f\u0430\u0440\u043e\u043b\u044c. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e \u0432 \u0444\u0430\u0439\u043b\u0435 \/etc\/postgresql\/*\/main\/pg_hba.conf . \u041d\u0430\u0439\u0442\u0438 \u0441\u0442\u0440\u043e\u043a\u0443, \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u044e\u0449\u0443\u044e \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440\u0430, \u0438 \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c peer \u043d\u0430 scram-sha-256:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>local   all             postgres                                scram-sha-256<\/code><\/pre>\n\n\n\n<p>\u0422\u0430\u043a\u0436\u0435 \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043d\u043e\u0432\u0443\u044e \u0441\u0442\u0440\u043e\u043a\u0443 \u0434\u043b\u044f \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u0430&nbsp;<strong>Docker<\/strong>&nbsp;\u043a \u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>host    postgres        postgres        172.18.0.0\/16           scram-sha-256<\/code><\/pre>\n\n\n\n<p>\u041f\u043e\u0441\u043b\u0435 \u0432\u0441\u0435\u0445 \u044d\u0442\u0438\u0445 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u0439 \u043d\u0430\u0448\u0430 \u0431\u0430\u0437\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d\u0430 \u0438 \u0433\u043e\u0442\u043e\u0432\u0430 \u043a \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044e. (\u0412 \u0446\u0435\u043b\u044f\u0445 \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u044f \u043d\u0435 \u0431\u0443\u0434\u0443 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0438 \u0432\u0441\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0431\u0443\u0434\u0443\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u043c postgres \u0432 \u0434\u0435\u0444\u043e\u043b\u0442\u043d\u043e\u0439 \u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 postgres, \u0447\u0435\u0433\u043e \u044f \u043d\u0430\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e \u043d\u0435 \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u044e \u0434\u0435\u043b\u0430\u0442\u044c \u0432 \u0440\u0430\u0431\u043e\u0447\u0438\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0445).<\/p>\n\n\n\n<p>\u041e\u0434\u043d\u0430\u043a\u043e \u0435\u0441\u043b\u0438 \u043c\u044b \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u0441\u0435\u0439\u0447\u0430\u0441 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c\u0441\u044f \u043a \u043d\u0430\u0448\u0435\u0439 \u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u0437 \u043d\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u0432\u044b\u0439\u0434\u0435\u0442, \u0442\u0430\u043a \u043a\u0430\u043a \u0432 \u0434\u0430\u043d\u043d\u044b\u0445 \u043c\u043e\u043c\u0435\u043d\u0442 \u0432 .env \u0444\u0430\u0439\u043b\u0435 \u0445\u043e\u0441\u0442 \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445 \u0441\u0442\u043e\u0438\u0442 db (\u0438\u043c\u044f \u0441\u0442\u0430\u0440\u043e\u0433\u043e \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430). \u041c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0431\u044b \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c \u0435\u0433\u043e \u043d\u0430&nbsp;<a href=\"http:\/\/localhost\/\" rel=\"noreferrer noopener\" target=\"_blank\">localhost<\/a>, \u043e\u0434\u043d\u0430\u043a\u043e \u043f\u043e \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u0443 Docker-\u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 \u043d\u0435 \u0438\u043c\u0435\u0435\u0442 \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u0441\u0435\u0442\u0438 \u043c\u0430\u0448\u0438\u043d\u044b, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043e\u043d \u0437\u0430\u043f\u0443\u0449\u0435\u043d. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0438\u0437\u043c\u0435\u043d\u044f\u0435\u043c \u0438\u0441\u0445\u043e\u0434\u043d\u0443\u044e \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>services:<br>\tbackend:<br>\t\timage: application:latest<br>\t\textra_hosts:<br>\t\t\t- \"host.docker.internal:host-gateway\"<br>\t\tports:<br>\t\t\t- \"127.0.0.1:8000:8000\"<br>\t\tenv_file:<br>\t\t\t- ..\/..\/.env<br>\t\tvolumes:<br>\t\t\t- ..\/..\/:\/app<\/code><\/pre>\n\n\n\n<p>\u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0431\u0430\u0437\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432\u044b\u043d\u0435\u0441\u0435\u043d\u0430, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0430 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430&nbsp;<a href=\"https:\/\/docs.docker.com\/reference\/compose-file\/build\/#extra_hosts\" rel=\"noreferrer noopener\" target=\"_blank\">extra_hosts<\/a>&nbsp;\u0434\u043b\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u0432\u043d\u0435\u0448\u043d\u0435\u0439 \u0441\u0435\u0442\u0438. \u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u0438\u0437\u043c\u0435\u043d\u044f\u0435\u043c .env \u0444\u0430\u0439\u043b, \u0443\u043a\u0430\u0437\u0430\u0432 \u0432 \u043d\u0451\u043c&nbsp;<a href=\"http:\/\/docs.docker.com\/desktop\/features\/networking\/#i-want-to-connect-from-a-container-to-a-service-on-the-host\" rel=\"noreferrer noopener\" target=\"_blank\">host.docker.internal<\/a>&nbsp;\u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0445\u043e\u0441\u0442\u0430.<\/p>\n\n\n\n<p>\u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0441\u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0442\u044c\u0441\u044f \u043a \u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u043d\u0430 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0439 \u043c\u0430\u0448\u0438\u043d\u0435. \u0421\u0442\u043e\u0438\u0442 \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u0432 \u0438\u0434\u0435\u0430\u043b\u044c\u043d\u043e\u043c \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0438 \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0438 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c \u0435\u043c\u0443 \u0434\u043e\u0441\u0442\u0443\u043f, \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u044f \u0435\u0433\u043e \u0434\u043b\u044f \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0445 \u0437\u0430\u0434\u0430\u0447 \u0441 \u0446\u0435\u043b\u044c\u044e \u043f\u043e\u0432\u044b\u0448\u0435\u043d\u0438\u044f&nbsp;<strong>\u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438<\/strong>&nbsp;\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u042d\u0442\u043e, \u0442\u0435\u043c \u043d\u0435 \u043c\u0435\u043d\u0435\u0435, \u043d\u0435 \u0432\u043b\u0438\u044f\u0435\u0442 \u043d\u0430 \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0435 \u0432\u044b\u0448\u0435 \u044d\u0442\u0430\u043f\u044b.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">\u0427\u0442\u043e-\u0442\u043e \u0435\u0449\u0435?<\/h4>\n\n\n\n<p>\u0415\u0441\u043b\u0438 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435 \u0432\u043a\u043b\u044e\u0447\u0451\u043d UFW (\u0444\u0430\u0435\u0440\u0432\u043e\u043b\u043b), \u043e\u043d \u043c\u043e\u0436\u0435\u0442 \u043a\u043e\u043d\u0444\u043b\u0438\u043a\u0442\u043e\u0432\u0430\u0442\u044c \u0441 \u0442\u0435\u043a\u0443\u0449\u0435\u0439 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0435\u0439, \u043d\u0435 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044f Docker-\u0441\u0435\u0442\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u0440\u0442 5432. \u0414\u043b\u044f \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u044d\u0442\u043e\u0439 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438 \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043d\u043e\u0432\u044b\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u0430, \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u043e\u0442\u043a\u0440\u044b\u0432 \u043f\u043e\u0440\u0442 5432:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo ufw delete deny 5432\/tcp<\/code><\/pre>\n\n\n\n<p>\u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo ufw allow from 172.17.0.0\/16 to any port 5432<br>sudo ufw allow from 172.18.0.0\/16 to any port 5432<br>sudo ufw deny 5432\/tcp<\/code><\/pre>\n\n\n\n<p>\u0417\u0434\u0435\u0441\u044c \u043c\u044b \u0440\u0430\u0437\u0440\u0435\u0448\u0430\u0435\u043c \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u0434\u043b\u044f \u043f\u043e\u0434\u0441\u0435\u0442\u0435\u0439 Docker \u0438 \u0437\u0430\u043f\u0440\u0435\u0449\u0430\u0435\u043c \u0434\u043e\u0441\u0442\u0443\u043f \u0438\u0437\u0432\u043d\u0435.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">\u0420\u0435\u0437\u044e\u043c\u0435<\/h4>\n\n\n\n<p>\u0412 \u0438\u0442\u043e\u0433\u0435 \u043d\u0430\u043c \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u043f\u0435\u0440\u0435\u0432\u0435\u0441\u0442\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043d\u0430 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u0443\u044e \u0431\u0430\u0437\u0443 \u0434\u0430\u043d\u043d\u044b\u0445, \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u043d\u0435\u0439, \u043d\u0430\u043b\u0430\u0434\u0438\u0442\u044c \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u043c\u0435\u0436\u0434\u0443 \u0431\u0430\u0437\u043e\u0439 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 Docker, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0432\u0441\u0451 \u044d\u0442\u043e \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u0412\u0441\u0435\u043c \u043f\u0440\u0438\u0432\u0435\u0442, \u0441\u0435\u0433\u043e\u0434\u043d\u044f \u044f \u0445\u043e\u0447\u0443 \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u0442\u044c \u0432\u0430\u043c \u043e \u0441\u0432\u043e\u0435\u043c \u043e\u043f\u044b\u0442\u0435 \u043f\u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 PostgreSQL \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435 \u0438 \u043a\u0430\u043a\u0438\u0435 \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0432\u043e\u0437\u043d\u0438\u043a\u043b\u0438 \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u0438, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043e \u0442\u043e\u043c \u043a\u0430\u043a \u0432\u0441\u0435 \u044d\u0442\u043e \u0440\u0435\u0448\u0438\u043b\u043e\u0441\u044c. \u0410 \u0441 \u043a\u0430\u043a\u043e\u0439 \u0446\u0435\u043b\u044c\u044e? \u041f\u0440\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u043d\u0430\u0448\u0435\u0433\u043e [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":1562,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[10],"tags":[49,17],"class_list":["post-1561","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-likbez","tag-docker","tag-postgresql","entry-card--landscape"],"_links":{"self":[{"href":"https:\/\/olvas.dev\/index.php?rest_route=\/wp\/v2\/posts\/1561","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/olvas.dev\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/olvas.dev\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/olvas.dev\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/olvas.dev\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1561"}],"version-history":[{"count":1,"href":"https:\/\/olvas.dev\/index.php?rest_route=\/wp\/v2\/posts\/1561\/revisions"}],"predecessor-version":[{"id":1563,"href":"https:\/\/olvas.dev\/index.php?rest_route=\/wp\/v2\/posts\/1561\/revisions\/1563"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/olvas.dev\/index.php?rest_route=\/wp\/v2\/media\/1562"}],"wp:attachment":[{"href":"https:\/\/olvas.dev\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1561"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/olvas.dev\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1561"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/olvas.dev\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1561"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}