{"id":363055,"date":"2024-05-21T01:48:00","date_gmt":"2024-05-21T01:48:00","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=363055"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=363055","title":{"rendered":"<span>\u0420\u0430\u0437\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0435\u043c \u0438 \u0437\u0430\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0435\u043c \u0432 docker \u043f\u0440\u043e\u0435\u043a\u0442 ASP.NET core \u043d\u0430 Ubuntu \u0432 \u0441\u0432\u044f\u0437\u043a\u0435 \u0441 PostgreSQL<\/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-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<h2>\u041f\u0440\u0435\u0434\u0438\u0441\u043b\u043e\u0432\u0438\u0435<\/h2>\n<p>\u0417\u0434\u0440\u0430\u0432\u0441\u0442\u0432\u0443\u0439\u0442\u0435. \u042f \u044f\u0432\u043b\u044f\u044e\u0441\u044c \u043d\u043e\u0432\u0438\u0447\u043a\u043e\u043c \u0432 \u0441\u0444\u0435\u0440\u0435 it. \u0418\u0434\u0435\u044f \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u0443\u044e \u0441\u0442\u0430\u0442\u044c\u044e \u043c\u043d\u0435 \u043f\u0440\u0438\u0448\u043b\u0430 \u043e\u0442\u0447\u0430\u0441\u0442\u0438 \u043e\u0442\u0442\u043e\u0433\u043e, \u0447\u0442\u043e, \u043f\u043e \u043c\u043e\u0438\u043c \u043d\u0430\u0431\u043b\u044e\u0434\u0435\u043d\u0438\u044f\u043c, \u0442\u0435\u043c\u0430 \u043f\u0440\u043e \u043f\u0430\u0440\u0443  dotnet \u0438 Linux \u043d\u0435 \u043e\u0441\u0432\u0435\u0449\u0435\u043d\u0430 \u0432 \u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u043e\u0431\u044a\u0451\u043c\u0430\u0445 (\u0441\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e \u0438\u0437-\u0437\u0430 \u043d\u0435\u043d\u0430\u0434\u043e\u0431\u043d\u043e\u0441\u0442\u0438), \u043d\u043e \u043a\u0430\u043a \u043d\u043e\u0432\u0438\u0447\u043e\u043a \u043d\u043e\u0432\u0438\u0447\u043a\u0443 \u0445\u043e\u0442\u0435\u043b \u0431\u044b \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u0442\u044c \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c\u0441\u044f \u0441 \u044d\u0442\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0435\u0439, \u0447\u0442\u043e \u0438 \u0431\u0443\u0434\u0435\u043c \u0434\u0435\u043b\u0430\u0442\u044c \u0432\u043c\u0435\u0441\u0442\u0435.<\/p>\n<h2>\u0417\u0430\u0434\u0430\u0447\u0430<\/h2>\n<p>\u0420\u0430\u0437\u0432\u0435\u0440\u043d\u0443\u0442\u044c \u043f\u0440\u043e\u0435\u043a\u0442 ASP.NET core \u0441 \u0448\u0430\u0431\u043b\u043e\u043d\u043e\u043c webapi \u043d\u0430 Ubuntu \u0432 \u0441\u0432\u044f\u0437\u043a\u0435 \u0441 PostgreSQL \u0438 \u043f\u043e\u043b\u043e\u0436\u0438\u0442\u044c \u0432\u0441\u0451 \u0432 docker \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u044b, \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0432 \u0438\u0445 \u0447\u0435\u0440\u0435\u0437 docker-compose.<\/p>\n<h2>\u041d\u0430\u0447\u0430\u043b\u043e<\/h2>\n<p>\u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0430\u043c \u0441\u0442\u043e\u0438\u043b\u043e \u0431\u044b \u0441\u043a\u0430\u0447\u0430\u0442\u044c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0439 \u0431\u0430\u0437\u0438\u0441 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 ASP.NET core \u0438 docker, docker-compose \u0432 \u0441\u0440\u0435\u0434\u0435 Linux \u043f\u043e\u0434 \u043d\u0443\u0436\u043d\u044b\u0439 \u0434\u0438\u0441\u0442\u0440\u0438\u0431\u0443\u0442\u0438\u0432(\u0432 \u043c\u043e\u0451\u043c \u0441\u043b\u0443\u0447\u0430\u0435 Ubuntu). \u041d\u0430 \u044d\u0442\u043e \u0432\u0440\u0435\u043c\u044f \u0442\u0440\u0430\u0442\u0438\u0442\u044c \u043d\u0435 \u0431\u0443\u0434\u0443, \u0442\u0430\u043a \u043a\u0430\u043a \u043d\u0430 \u043f\u0440\u043e\u0441\u0442\u043e\u0440\u0430\u0445 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0430 \u0434\u0430\u043d\u043d\u044b\u0435 \u0442\u0435\u043c\u044b \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u043e\u043f\u0438\u0441\u0430\u043d\u044b. <\/p>\n<details class=\"spoiler\">\n<summary>\u041f\u043e\u043b\u0435\u0437\u043d\u044b\u0439 \u0441\u0441\u044b\u043b\u043a\u0438<\/summary>\n<div class=\"spoiler__content\">\n<ul>\n<li>\n<p><a href=\"https:\/\/timeweb.cloud\/tutorials\/docker\/kak-ustanovit-docker-na-ubuntu-22-04\" rel=\"noopener noreferrer nofollow\">https:\/\/timeweb.cloud\/tutorials\/docker\/kak-ustanovit-docker-na-ubuntu-22-04<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/timeweb.cloud\/tutorials\/docker\/kak-ustanovit-docker-na-ubuntu-22-04\" rel=\"noopener noreferrer nofollow\">https:\/\/timeweb.cloud\/tutorials\/docker\/kak-ustanovit-docker-na-ubuntu-22-04<\/a><\/p>\n<\/li>\n<\/ul>\n<\/div>\n<\/details>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e \u043a\u0430\u043a \u0432\u0441\u0451 \u0441\u043a\u0430\u0447\u0430\u043b\u0438 \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u043b\u0438 \u043d\u0430 \u0440\u0430\u0431\u043e\u0442\u043e\u0441\u043f\u043e\u0441\u043e\u0431\u043d\u043e\u0441\u0442\u044c: <code>docker -v &amp; docker-compose -v &amp; dotnet --info<\/code>, \u043c\u043e\u0436\u0435\u043c \u043f\u0440\u0438\u0441\u0442\u0443\u043f\u0430\u0442\u044c \u043a \u0440\u0430\u0431\u043e\u0442\u0435. <\/p>\n<h2>\u0413\u043b\u0430\u0432\u0430 1<\/h2>\n<figure class=\"float\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/fb3\/7af\/244\/fb37af2441dc6779d8b849b38d8ec57d.png\" width=\"363\" height=\"72\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/fb3\/7af\/244\/fb37af2441dc6779d8b849b38d8ec57d.png\"\/><\/figure>\n<p>\u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0434\u0438\u0440\u0435\u043a\u0442\u0440\u0438\u044e \u0438 \u0432\u043b\u043e\u0436\u0438\u043c \u0432 \u043d\u0435\u0451 \u0444\u0430\u0439\u043b docker-compose.yml \u0438 \u043f\u0430\u043f\u043a\u0443. \u042f \u0440\u0430\u0431\u043e\u0442\u0430\u044e \u0432 VS code \u0438 \u0434\u0430\u043d\u043d\u0430\u044f \u0438\u0441\u0442\u043e\u0440\u0438\u044f \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c.<\/p>\n<figure class=\"float bordered\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/555\/850\/39d\/55585039d6977fd600dd52b028eb4f74.png\" alt=\"\u0418\u0442\u043e\u0433\u043e\u0432\u044b\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a\" title=\"\u0418\u0442\u043e\u0433\u043e\u0432\u044b\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a\" width=\"217\" height=\"208\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/555\/850\/39d\/55585039d6977fd600dd52b028eb4f74.png\"\/><\/p>\n<div><figcaption><strong><u>\u0418\u0442\u043e\u0433\u043e\u0432\u044b\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a<\/u><\/strong><\/figcaption><\/div>\n<\/figure>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0447\u0435\u0433\u043e \u043e\u0442\u043a\u0440\u043e\u0435\u043c \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b \u0438 \u043f\u0435\u0440\u0435\u0439\u0434\u0451\u043c \u043f\u043e \u043f\u0443\u0442\u0438 \u0432 \u043d\u0430\u0448\u0443 \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u0443\u044e \u043f\u0430\u043f\u043a\u0443(\u0432 \u043c\u043e\u0451\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u044d\u0442\u043e <code>cd .\/app<\/code>). \u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u043c\u0430\u043d\u0434\u044b <code>dotnet -h<\/code> \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043a\u0430\u043a\u0438\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u043d\u0430\u043c \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b. \u0422\u0430\u043a \u043a\u0430\u043a \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0440\u0430\u0437\u0432\u0435\u0440\u043d\u0443\u0442\u044c \u043f\u0440\u043e\u0435\u043a\u0442, \u043c\u044b \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u043c <code>new<\/code>. \u0427\u0442\u043e\u0431\u044b \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u043a\u0430\u043a\u0438\u0435 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u043f\u0438\u0441\u0430\u0442\u044c, \u043f\u0440\u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c <code>dotnet new -h<\/code>, \u043f\u043e\u0441\u043b\u0435 \u0447\u0435\u0433\u043e \u0432\u0438\u0434\u0438\u043c, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043a\u0430\u043a\u0438\u0435 \u0448\u0430\u0431\u043b\u043e\u043d\u044b \u0443 \u043d\u0430\u0441 \u0438\u043c\u0435\u044e\u0442\u0441\u044f, \u043c\u043e\u0436\u0435\u043c <\/p>\n<p>\u043f\u0440\u043e\u043f\u0438\u0441\u0430\u0442\u044c <code>dotnet new list.<\/code> \u041e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0432\u0448\u0438\u0441\u044c \u0441 \u0448\u0430\u0431\u043b\u043e\u043d\u043e\u043c \u043f\u0440\u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c <code>dotnet new (\u0432 \u043c\u043e\u0451\u043c \u0441\u043b\u0443\u0447\u0430\u0435: webapi) --no-https -controllers<\/code>. <em>\u0417\u0430\u043c\u0435\u0442\u0438\u043c, \u0447\u0442\u043e \u0432\u0441\u0435 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c, \u043f\u0440\u043e\u043f\u0438\u0441\u0430\u0432 <\/em><code>-h<\/code><strong><em>,<\/em><\/strong><em> \u0447\u0442\u043e \u043a\u0430\u0441\u0430\u0435\u0442\u0441\u044f \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e dotnet.<\/em><\/p>\n<figure class=\"float bordered\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/469\/a42\/76d\/469a4276d748abbbda3cc80f360c441d.png\" alt=\"\" title=\"\" width=\"417\" height=\"147\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/469\/a42\/76d\/469a4276d748abbbda3cc80f360c441d.png\"\/><\/figure>\n<p>\u0417\u0430\u043f\u0443\u0441\u0442\u0438\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u043c \u0440\u0430\u0431\u043e\u0442\u043e\u0441\u043f\u043e\u0441\u043e\u0431\u043d\u043e\u0441\u0442\u044c. \u041d\u0430\u043f\u0438\u0448\u0435\u043c \u043a\u043e\u043c\u0430\u043d\u0434\u0443 <code>dotnet run<\/code> \u0438 \u0432 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u0435 \u0432\u044b\u0432\u0435\u0434\u0435\u0442\u0441\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435.\u041c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u043e\u0441\u043f\u043e\u0441\u043e\u0431\u043d\u043e\u0441\u0442\u044c, \u0437\u0430\u0439\u0434\u044f \u043f\u043e url, \u043d\u043e \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u043c \u0434\u0430\u043b\u044c\u0448\u0435.<\/p>\n<h2>\u0413\u043b\u0430\u0432\u0430 2<\/h2>\n<figure class=\"float bordered\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/698\/d0e\/6ea\/698d0e6ead82e7586d6f53be433775f2.png\" width=\"182\" height=\"127\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/698\/d0e\/6ea\/698d0e6ead82e7586d6f53be433775f2.png\"\/><\/figure>\n<p>\u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0432 \u0433\u043b\u0430\u0432\u043d\u043e\u0439 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 \u043f\u0430\u043f\u043a\u0443 docker. \u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0432 \u044d\u0442\u043e\u0439 \u043f\u0430\u043f\u043a\u0435 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435: <strong>dotnet, nginx, bd<\/strong>. \u041f\u0430\u043f\u043a\u0430 <strong>dotnet<\/strong> \u0434\u043b\u044f \u0434\u043e\u043a\u0435\u0440\u0444\u0430\u0439\u043b\u043e\u0432 \u0438 \u0434\u0440\u0443\u0433\u0438\u0445 \u0441\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0449\u0438\u0445, <strong>bd<\/strong> \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0444\u0430\u0439\u043b\u044b \u0438\u0437 \u0434\u043e\u043a\u0435\u0440 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 \u0441 \u0434\u0430\u043d\u043d\u043e\u0439 \u043f\u0430\u043f\u043a\u043e\u0439, <strong>nginx<\/strong> \u0434\u043b\u044f \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0430\u0446\u0438\u0438 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0439.<\/p>\n<figure class=\"float bordered\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/320\/333\/951\/3203339515d3d43383d896818b9371a1.png\" width=\"411\" height=\"271\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/320\/333\/951\/3203339515d3d43383d896818b9371a1.png\"\/><\/figure>\n<p>\u041f\u0435\u0440\u0435\u0439\u0434\u0451\u043c \u043a <strong>dockerfile<\/strong> \u0432 \u043f\u0430\u043f\u043a\u0435 <strong>dotnet <\/strong>\u0438 \u043f\u0440\u043e\u043f\u0438\u0448\u0435\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435 \u043f\u043e \u0436\u0435\u043b\u0430\u043d\u0438\u044e. \u0414\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u0434 \u0432\u0437\u044f\u0442 \u0441 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0439 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438.<\/p>\n<details class=\"spoiler\">\n<summary>\u041a\u0440\u0430\u0442\u043a\u043e \u043f\u0440\u043e\u0431\u0435\u0436\u0438\u043c\u0441\u044f \u043f\u043e \u043a\u043e\u0434\u0443:<\/summary>\n<div class=\"spoiler__content\">\n<ol>\n<li>\n<p>\u0421\u043a\u0430\u0447\u0438\u0432\u0430\u0435\u043c <strong>sdk<\/strong> \u043e\u0431\u0440\u0430\u0437, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f <code>workdir<\/code> \u043d\u0430\u0437\u043d\u0430\u0447\u0430\u0435\u043c \u043f\u0430\u043f\u043a\u0443 <strong>source<\/strong> \u0432 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0435 \u043a\u0430\u043a \u043f\u0430\u043f\u043a\u0443 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e.<\/p>\n<\/li>\n<li>\n<p>\u041a\u043e\u043f\u0438\u0440\u0443\u0435\u043c \u043f\u0440\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0435 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 \u0444\u0430\u0439\u043b\u044b .sln \u0438 .csproj. \u0438 \u043f\u0430\u043f\u043a\u0443 \u0441 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u043c.<\/p>\n<\/li>\n<li>\n<p>\u041d\u0430\u0437\u043d\u0430\u0447\u0430\u0435\u043c \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u043f\u0430\u043f\u043a\u0443 \u0441 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u043c.<\/p>\n<\/li>\n<li>\n<p>\u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c restore, \u0447\u0442\u043e\u0431\u044b \u0437\u0430\u0441\u0443\u043d\u0443\u0442\u044c \u0432 \u043a\u044d\u0448 \u043d\u0435\u0438\u0437\u043c\u0435\u043d\u044f\u0435\u043c\u044b\u0435 \u0444\u0430\u0439\u043b\u044b.<\/p>\n<\/li>\n<li>\n<p>\u041f\u0443\u0431\u043b\u0438\u043a\u0443\u0435\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435<\/p>\n<\/li>\n<li>\n<p>\u0421\u043a\u0430\u0447\u0438\u0432\u0430\u0435\u043c \u043e\u0431\u0440\u0430\u0437 \u0441 runtime etc.<\/p>\n<\/li>\n<li>\n<p>\u0417\u0430\u0434\u0430\u0451\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f \u043f\u043e \u0436\u0435\u043b\u0430\u043d\u0438\u044e.<\/p>\n<\/li>\n<li>\n<p>\u041d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c \u043f\u0430\u043f\u043a\u0443 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e.<\/p>\n<\/li>\n<li>\n<p>\u041a\u043e\u043f\u0438\u0440\u0443\u0435\u043c \u043f\u0430\u043f\u043a\u0443 \u0441 \u043e\u0431\u0440\u0430\u0437\u0430 \u0432\u044b\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u043a\u0430\u043a <strong>build.<\/strong><\/p>\n<\/li>\n<li>\n<p>\u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u043a\u0440\u043e\u0441\u0441\u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435\u043d\u043d\u044b\u0439 \u0444\u0430\u0439\u043b.<\/p>\n<\/li>\n<\/ol>\n<\/div>\n<\/details>\n<details class=\"spoiler\">\n<summary>\u041f\u043e\u043b\u0435\u0437\u043d\u044b\u0439 \u0441\u0441\u044b\u043b\u043a\u0438<\/summary>\n<div class=\"spoiler__content\">\n<ul>\n<li>\n<p><a href=\"https:\/\/docs.docker.com\/engine\/reference\/commandline\/build\/\" rel=\"noopener noreferrer nofollow\">https:\/\/docs.docker.com\/engine\/reference\/commandline\/build\/<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/www.baeldung.com\/ops\/dockerfile-run-cmd-entrypoint\" rel=\"noopener noreferrer nofollow\">https:\/\/www.baeldung.com\/ops\/dockerfile-run-cmd-entrypoint<\/a><\/p>\n<\/li>\n<\/ul>\n<\/div>\n<\/details>\n<p><u>\u041d\u0430\u0441\u0442\u0440\u043e\u0438\u043c \u0444\u0430\u0439\u043b docker-compose<\/u><\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/517\/c7d\/7bc\/517c7d7bcb6fa288804c532a6011b877.png\" width=\"472\" height=\"816\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/517\/c7d\/7bc\/517c7d7bcb6fa288804c532a6011b877.png\"\/><\/figure>\n<details class=\"spoiler\">\n<summary>\u041a\u0440\u0430\u0442\u043a\u043e \u043f\u0440\u043e\u0431\u0435\u0436\u0438\u043c\u0441\u044f \u043f\u043e \u043a\u043e\u0434\u0443<\/summary>\n<div class=\"spoiler__content\">\n<ol>\n<li>\n<p>\u0423\u043a\u0430\u0436\u0435\u043c \u0432\u0435\u0440\u0441\u0438\u044e<\/p>\n<\/li>\n<li>\n<p>\u0420\u0430\u0437\u0431\u0435\u0440\u0451\u043c\u0441\u044f \u0441\u043e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043e\u0439 \u043a\u0430\u0436\u0434\u043e\u0433\u043e image: <\/p>\n<ol>\n<li>\n<p><strong>image<\/strong> \u0438\u043b\u0438 build &#8212; \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u043e\u0442\u043a\u0443\u0434\u0430 \u0431\u0443\u0434\u0435\u0442 \u0441\u0442\u0440\u043e\u0438\u0442\u044c\u0441\u044f \u043e\u0431\u0440\u0430\u0437<\/p>\n<\/li>\n<li>\n<p><strong>volumes<\/strong> &#8212; \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0430\u0446\u0438\u044f \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0445 \u0444\u0430\u0439\u043b\u043e\u0432, \u043f\u0430\u043f\u043e\u043a \u0438 \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0445 \u0438\u043c<\/p>\n<\/li>\n<li>\n<p><strong>depends_on<\/strong> \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0441\u044f \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u044b\u0439 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440<\/p>\n<\/li>\n<li>\n<p><strong>environment<\/strong> &#8212; \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0441\u0440\u0435\u0434\u044b \u0434\u043b\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0442\u043e\u0433\u043e \u0438\u043b\u0438 \u0438\u043d\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0432\u043d\u0443\u0442\u0440\u0438 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430<\/p>\n<\/li>\n<li>\n<p><strong>ports<\/strong> &#8212; \u043f\u0440\u043e\u043a\u0438\u0434\u044b\u0432\u0430\u0435\u043c \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0435 \u043f\u043e\u0440\u0442\u044b \u0434\u043e\u043a\u0435\u0440 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u043e\u0432 \u0432\u043e \u0432\u043d\u0435\u0448\u043d\u0438\u0435 <\/p>\n<\/li>\n<li>\n<p><strong>networks<\/strong> &#8212; \u0441\u0435\u0442\u044c \u043f\u043e \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043d\u0430\u0448\u0438 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u044b \u0431\u0443\u0434\u0443\u0442 \u043e\u0431\u0449\u0430\u0442\u044c\u0441\u044f<\/p>\n<ol>\n<li>\n<p><strong>ipam<\/strong> \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 ip \u0430\u0434\u0440\u0435\u0441\u0430<\/p>\n<\/li>\n<li>\n<p><strong>driver default<\/strong> &#8212; bridge<\/p>\n<\/li>\n<li>\n<p><strong>config subnet<\/strong> \u0438 <strong>gateway<\/strong>&#8212; \u043c\u0430\u0441\u043a\u0430 \u043f\u043e\u0434\u0441\u0435\u0442\u0438 \u0438 \u0441\u0435\u0442\u0435\u0432\u043e\u0439 \u0448\u043b\u044e\u0437<\/p>\n<\/li>\n<\/ol>\n<\/li>\n<\/ol>\n<\/li>\n<\/ol>\n<p>\u041d\u043e \u0432\u0441\u0451 \u044d\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c \u0443\u043a\u0430\u0437\u0430\u0432 \u0441\u0435\u0442\u044c bridge<\/p>\n<\/div>\n<\/details>\n<p><u>\u041d\u0430\u0441\u0442\u0440\u043e\u0435\u043c \u0444\u0430\u0439\u043b nginx<\/u><\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/57e\/8a8\/671\/57e8a86714f78fd06f21d5dc3cc95d46.png\" width=\"594\" height=\"361\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/57e\/8a8\/671\/57e8a86714f78fd06f21d5dc3cc95d46.png\"\/><\/figure>\n<details class=\"spoiler\">\n<summary>\u041a\u0440\u0430\u0442\u043a\u043e \u043f\u0440\u043e\u0431\u0435\u0436\u0438\u043c\u0441\u044f \u043f\u043e \u043a\u043e\u0434\u0443<\/summary>\n<div class=\"spoiler__content\">\n<ol>\n<li>\n<\/li>\n<\/ol>\n<\/div>\n<\/details>\n<details class=\"spoiler\">\n<summary>\u041f\u043e\u043b\u0435\u0437\u043d\u044b\u0439 \u0441\u0441\u044b\u043b\u043a\u0438<\/summary>\n<div class=\"spoiler__content\">\n<ul>\n<li>\n<p><a href=\"https:\/\/nginx.org\/en\/docs\/http\/ngx_http_upstream_module.html\" rel=\"noopener noreferrer nofollow\">https:\/\/nginx.org\/en\/docs\/http\/ngx_http_upstream_module.html<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/learn.microsoft.com\/ru-ru\/aspnet\/core\/host-and-deploy\/linux-nginx?view=aspnetcore-8.0&amp;tabs=linux-ubuntu\" rel=\"noopener noreferrer nofollow\">https:\/\/learn.microsoft.com\/ru-ru\/aspnet\/core\/host-and-deploy\/linux-nginx?view=aspnetcore-8.0&amp;tabs=linux-ubuntu<\/a><\/p>\n<\/li>\n<\/ul>\n<\/div>\n<\/details>\n<h2>\u0413\u043b\u0430\u0432\u0430 3<\/h2>\n<p>\u041f\u043e\u0441\u043b\u0435 \u043f\u0440\u043e\u0434\u0435\u043b\u0430\u043d\u043d\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u044b \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u043c\u0441\u044f \u0432 \u043d\u0430\u0448\u0443 \u043f\u0430\u043f\u043a\u0443 \u0441 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u043c cd app \u0438 \u0432 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u0435 \u0443\u043a\u0430\u0436\u0435\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043a\u043e\u0434 dotnet add package Npgsql.EntityFrameworkCore.PostgreSQL &#8212;version 8.0.0\u044d\u0442\u043e\u0442 \u043f\u0430\u043a\u0435\u0442 \u0441\u043b\u0443\u0436\u0438\u0442 \u0434\u043b\u044f \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0441 PostgreSQL. \u0422\u0430\u043a\u0436\u0435 \u043d\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 EF core, \u0438 \u0432 \u044d\u0442\u043e\u043c \u043d\u0430\u043c \u043f\u043e\u043c\u043e\u0436\u0435\u0442  \u043a\u043e\u043c\u0430\u043d\u0434\u0430 dotnet tool install &#8212;global dotnet-ef.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/2f1\/a79\/801\/2f1a79801c299df98727f5ef2f6b1893.png\" alt=\"\u041f\u0440\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u0439 \u043f\u0430\u043a\u0435\u0442 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u0435 dotnet list package \" title=\"\u041f\u0440\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u0439 \u043f\u0430\u043a\u0435\u0442 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u0435 dotnet list package \" width=\"533\" height=\"83\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/2f1\/a79\/801\/2f1a79801c299df98727f5ef2f6b1893.png\"\/><\/p>\n<div><figcaption><strong>\u041f\u0440\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u0439 \u043f\u0430\u043a\u0435\u0442 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u0435<\/strong><code> dotnet list package <\/code><\/figcaption><\/div>\n<\/figure>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/1cc\/ad7\/c4c\/1ccad7c4c9ae5713b05507d033926b95.png\" alt=\"\u041f\u0440\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u0435 dotnet tool list -g\" title=\"\u041f\u0440\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u0435 dotnet tool list -g\" width=\"533\" height=\"50\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/1cc\/ad7\/c4c\/1ccad7c4c9ae5713b05507d033926b95.png\"\/><\/p>\n<div><figcaption><strong>\u041f\u0440\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u0435<\/strong> <code>dotnet tool list -g<\/code><\/figcaption><\/div>\n<\/figure>\n<p>\u0420\u0430\u043d\u043d\u0435\u0435 \u043c\u044b \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u043b\u0438 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u044b \u0441 \u0431\u0434 \u043f\u043e \u043f\u043e\u0440\u0442\u0443 54332 \u0438 adminer \u043f\u043e \u043f\u043e\u0440\u0442\u0443 8080. \u0417\u0430\u0439\u0434\u044f \u043f\u043e <code>http:\/\/localhost:8080\/<\/code> \u043d\u0430\u043c \u043e\u0442\u043a\u0440\u043e\u0435\u0442\u0441\u044f \u043f\u0430\u043d\u0435\u043b\u044c \u0434\u043b\u044f \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0431\u0434. \u0412\u0432\u043e\u0434\u0438\u043c \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u0444\u043e\u0440\u043c\u0443, \u043f\u043e\u0441\u043b\u0435 \u0447\u0435\u0433\u043e \u043d\u0430\u0441 \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0438\u0442 \u0432 \u0430\u0434\u043c\u0438\u043d \u043f\u0430\u043d\u0435\u043b\u044c. \u0422\u0430\u043a\u0436\u0435 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0431\u0434 \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u043f\u043b\u0430\u0433\u0438\u043d\u0443 <strong>vs code Database <\/strong>\u0438\u043b\u0438 \u0436\u0435 \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f <strong>pgAdmin. <\/strong><\/p>\n<figure class=\"float bordered\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/0bd\/c17\/53a\/0bdc1753ae16ce56e3fd5508c83df188.png\" alt=\"cat.cs\" title=\"cat.cs\" width=\"349\" height=\"238\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/0bd\/c17\/53a\/0bdc1753ae16ce56e3fd5508c83df188.png\"\/><\/p>\n<div><figcaption><strong>cat.cs<\/strong><\/figcaption><\/div>\n<\/figure>\n<p>\u0422\u0430\u043a \u043a\u0430\u043a \u0432 \u0431\u0434 \u043f\u0443\u0441\u0442\u043e, \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u043c. \u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0444\u0430\u0439\u043b \u0432 \u043f\u0430\u043f\u043a\u0435 <strong>app: context.cs<\/strong> \u0438 <strong>cat.cs<\/strong> \u0438 \u0437\u0430\u043f\u043e\u043b\u043d\u0438\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043a\u043e\u0434\u043e\u043c<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/697\/a09\/b99\/697a09b99051d40c4caff9752e08e14b.png\" alt=\"context.cs\" title=\"context.cs\" width=\"765\" height=\"259\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/697\/a09\/b99\/697a09b99051d40c4caff9752e08e14b.png\"\/><\/p>\n<div><figcaption>context.cs<\/figcaption><\/div>\n<\/figure>\n<p>\u0422\u0430\u043a \u043a\u0430\u043a \u043c\u044b \u043d\u0435 \u0443\u043a\u0430\u0437\u0430\u043b\u0438 host \u0432 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u0445 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 <strong>PostgreSQL, <\/strong>\u0442\u043e \u043e\u043d \u043d\u0430\u043c \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u043f\u043e \u0434\u0435\u0444\u043e\u043b\u0442\u043d\u043e\u043c\u0443 \u0445\u043e\u0441\u0442\u0443 <strong>localhost. <\/strong>\u0422\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u044e. \u0418\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u043c \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0438 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <code>dotnet ef migrations add initia<\/code> \u0438 <code>dotnet ef database update.<\/code>\u0422\u0435\u043f\u0435\u0440\u044c \u0437\u0430\u0439\u0434\u044f \u0432 \u043d\u0430\u0448\u0443 \u0441\u0440\u0435\u0434\u0443 \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u043c\u044b \u0443\u0432\u0438\u0434\u0438\u043c, \u0447\u0442\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u043b\u0430\u0441\u044c \u0442\u0430\u0431\u043b\u0438\u0446\u0430 <strong>Cats. <\/strong><\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/c33\/e54\/3c0\/c33e543c0c281a7e3db3a35eea551eed.png\" width=\"685\" height=\"218\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/c33\/e54\/3c0\/c33e543c0c281a7e3db3a35eea551eed.png\"\/><\/figure>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043e\u0431\u0440\u0430\u0449\u0430\u0442\u044c\u0441\u044f \u0432 controllers \u043a \u0431\u0434. <\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/9c6\/298\/197\/9c629819751be6f5ea2beccf84822c7e.png\" alt=\" \" title=\" \" width=\"686\" height=\"373\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/9c6\/298\/197\/9c629819751be6f5ea2beccf84822c7e.png\"\/><\/p>\n<div><figcaption> <\/figcaption><\/div>\n<\/figure>\n<figure class=\"float bordered\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/a19\/3ac\/2c5\/a193ac2c546f8c79141a45809ea68840.png\" alt=\"  \" title=\"  \" width=\"414\" height=\"251\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/a19\/3ac\/2c5\/a193ac2c546f8c79141a45809ea68840.png\"\/><\/p>\n<div><figcaption>  <\/figcaption><\/div>\n<\/figure>\n<p>\u041e\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u044b, \u0443\u0434\u0430\u043b\u044f\u0435\u043c \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 \u0441 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u043c. \u041f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043c \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u044b, \u0442\u0430\u043a \u043a\u0430\u043a \u043c\u044b \u0442\u043e\u043b\u044c\u043a\u043e \u0443\u043f\u0430\u043a\u043e\u0432\u044b\u0432\u0430\u0435\u043c \u0433\u043e\u0442\u043e\u0432\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435.   \u041f\u043e \u0430\u0434\u0440\u0435\u0441\u0443 <code>http:\/\/api.prop.loc\/Cat<\/code> \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0441\u0434\u0435\u043b\u0430\u0442\u044c get \u0437\u0430\u043f\u0440\u043e\u0441 \u043d\u0430 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0438 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u043a\u043e\u0442\u0438\u043a\u0430. \u0427\u0442\u043e\u0431\u044b \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437 \u043d\u0435 \u0443\u0434\u0430\u043b\u044f\u0442\u044c \u0438 \u043d\u0435 \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u044b, \u043f\u0440\u0438 \u0436\u0435\u043b\u0430\u043d\u0438\u0438 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u0440\u043e\u043f\u0438\u0441\u0430\u0442\u044c <strong>volumes<\/strong>, \u043d\u043e \u044d\u0442\u043e \u0434\u0440\u0443\u0433\u0430\u044f \u0438\u0441\u0442\u043e\u0440\u0438\u044f.<\/p>\n<p>\u0412\u043e\u0442 \u0442\u0430\u043a \u043f\u0440\u043e\u0441\u0442\u043e \u0438 \u0440\u0430\u0437\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0435\u043a\u0442 <strong>ASP.NET core<\/strong> \u0432 \u0441\u0440\u0435\u0434\u0435 <strong>Ubuntu<\/strong> \u0432 \u0441\u0432\u044f\u0437\u043a\u0435 \u0441 <strong>PostgreSQL <\/strong>\u0438 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u0439 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0438\u0437\u0430\u0446\u0438\u0435\u0439 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435 <strong>nginx<\/strong> + <strong>kestrel<\/strong>, \u0438 <strong>\u043a\u043e\u0442\u0438\u043a\u0430\u043c\u0438<\/strong>.<\/p>\n<h2>\u0411\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044e, \u0447\u0442\u043e \u0434\u043e\u0447\u0438\u0442\u0430\u043b\u0438 \u0434\u0430\u043d\u043d\u0443\u044e \u0441\u0442\u0430\u0442\u044c\u044e<\/h2>\n<details class=\"spoiler\">\n<summary>\u0427\u0430\u0441\u0442\u044b\u0435 \u043e\u0448\u0438\u0431\u043a\u0438<\/summary>\n<div class=\"spoiler__content\">\n<details class=\"spoiler\">\n<summary>EF core error<\/summary>\n<div class=\"spoiler__content\">\n<p><code>You must install .NET to run this application.App: \/home\/danis\/.dotnet\/tools\/dotnet-ef Architecture: x64 App host version: 8.0.0 .NET location: Not foundLearn more: https:\/\/aka.ms\/dotnet\/app-launch-failedDownload the .NET runtime: https:\/\/aka.ms\/dotnet-core-applaunch?missing_runtime=true&amp;arch=x64&amp;rid=linux-x64&amp;os=ubuntu.22.04&amp;apphost_version=8.0.0<\/code><\/p>\n<p>\u0414\u0430\u043d\u043d\u0443\u044e \u043e\u0448\u0438\u0431\u043a\u0443 \u043c\u043e\u0436\u043d\u043e \u0440\u0435\u0448\u0438\u0442\u044c, \u043f\u0440\u043e\u043f\u0438\u0441\u0430\u0432 e<code>xport DOTNET_ROOT=\/usr\/share\/dotnet<\/code>(\u043f\u0443\u0442\u044c \u0434\u043e \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f <strong>dotnet<\/strong> \u0441 <strong>sdk<\/strong> \u0438 <strong>runtime(<\/strong>\u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0438\u043d\u0434\u0438\u0432\u0438\u0434\u0443\u0430\u043b\u044c\u043d\u043e)) \u0422\u0430\u043a\u0436\u0435 \u044d\u0442\u0443 \u043f\u0435\u0440\u043c\u0435\u043d\u043d\u0443\u044e \u043c\u043e\u0436\u043d\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u043f\u0440\u0438 \u043a\u0430\u0436\u0434\u043e\u043c \u0432\u0445\u043e\u0434\u0435 \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0443(\u043e\u0442\u0434\u0435\u043b\u044c\u043d\u0430\u044f \u0442\u0435\u043c\u0430).<\/p>\n<\/div>\n<\/details>\n<details class=\"spoiler\">\n<summary>\u0412 \u0441\u043b\u0443\u0447\u0430\u0435, \u0435\u0441\u043b\u0438 \u0432\u044b \u0443\u043a\u0430\u0437\u0430\u043b\u0438 \u0445\u043e\u0441\u0442 \u0432 nginx \u0438 \u043f\u043e \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u043f\u0440\u0438\u0447\u0438\u043d\u0435 \u0443 \u0432\u0430\u0441 \u043d\u0435 \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430<\/summary>\n<div class=\"spoiler__content\">\n<figure class=\"float bordered\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/d8c\/c1b\/81c\/d8cc1b81cb2204dd95bc8ec7a3a85856.png\" width=\"276\" height=\"45\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/d8c\/c1b\/81c\/d8cc1b81cb2204dd95bc8ec7a3a85856.png\"\/><\/figure>\n<p>\u0422\u043e \u0441\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e \u043d\u0443\u0436\u043d\u043e \u0440\u0430\u0437\u0440\u0435\u0448\u0438\u0442\u044c \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0445\u043e\u0441\u0442\u0430 \u0434\u043e\u0441\u0442\u0443\u043f \u0447\u0435\u0440\u0435\u0437 sudo nano \/etc\/hosts<\/p>\n<\/div>\n<\/details>\n<details class=\"spoiler\">\n<summary>\u0412 \u0441\u043b\u0443\u0447\u0430\u0435, \u0435\u0441\u043b\u0438 \u0432\u044b \u0434\u0435\u043b\u0430\u0435\u0442\u0435 docker-compose up \u0438 docker \u0432\u044b\u0434\u0430\u0451\u0442 \u043e\u0448\u0438\u0431\u043a\u0443 \u043f\u043e \u0442\u0438\u043f\u0443: permission denied while trying to connect to the Docker daemon socket at unix:\/\/\/var\/run\/docker.sock: Get &#171;http:\/\/%2Fvar%2Frun%2Fdocker.sock\/v1.24\/containers\/json?all=1&amp;filters=%7B%22label%22%3A%7B%22com.docker.compose.config-hash%22%3Atrue%2C%22com.docker.compose.project%3Dproject%22%3Atrue%7D%7D&#187;: dial unix \/var\/run\/docker.sock: connect: permission denied<\/summary>\n<div class=\"spoiler__content\">\n<p>\u0421\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e \u0432\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u043f\u0440\u043e\u043f\u0438\u0441\u0430\u0442\u044c \u043f\u0435\u0440\u0435\u0434 docker &#171;sudo&#187;<\/p>\n<\/div>\n<\/details>\n<\/div>\n<\/details>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/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\/articles\/780952\/\"> https:\/\/habr.com\/ru\/articles\/780952\/<\/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-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<h2>\u041f\u0440\u0435\u0434\u0438\u0441\u043b\u043e\u0432\u0438\u0435<\/h2>\n<p>\u0417\u0434\u0440\u0430\u0432\u0441\u0442\u0432\u0443\u0439\u0442\u0435. \u042f \u044f\u0432\u043b\u044f\u044e\u0441\u044c \u043d\u043e\u0432\u0438\u0447\u043a\u043e\u043c \u0432 \u0441\u0444\u0435\u0440\u0435 it. \u0418\u0434\u0435\u044f \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u0443\u044e \u0441\u0442\u0430\u0442\u044c\u044e \u043c\u043d\u0435 \u043f\u0440\u0438\u0448\u043b\u0430 \u043e\u0442\u0447\u0430\u0441\u0442\u0438 \u043e\u0442\u0442\u043e\u0433\u043e, \u0447\u0442\u043e, \u043f\u043e \u043c\u043e\u0438\u043c \u043d\u0430\u0431\u043b\u044e\u0434\u0435\u043d\u0438\u044f\u043c, \u0442\u0435\u043c\u0430 \u043f\u0440\u043e \u043f\u0430\u0440\u0443  dotnet \u0438 Linux \u043d\u0435 \u043e\u0441\u0432\u0435\u0449\u0435\u043d\u0430 \u0432 \u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u043e\u0431\u044a\u0451\u043c\u0430\u0445 (\u0441\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e \u0438\u0437-\u0437\u0430 \u043d\u0435\u043d\u0430\u0434\u043e\u0431\u043d\u043e\u0441\u0442\u0438), \u043d\u043e \u043a\u0430\u043a \u043d\u043e\u0432\u0438\u0447\u043e\u043a \u043d\u043e\u0432\u0438\u0447\u043a\u0443 \u0445\u043e\u0442\u0435\u043b \u0431\u044b \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u0442\u044c \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c\u0441\u044f \u0441 \u044d\u0442\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0435\u0439, \u0447\u0442\u043e \u0438 \u0431\u0443\u0434\u0435\u043c \u0434\u0435\u043b\u0430\u0442\u044c \u0432\u043c\u0435\u0441\u0442\u0435.<\/p>\n<h2>\u0417\u0430\u0434\u0430\u0447\u0430<\/h2>\n<p>\u0420\u0430\u0437\u0432\u0435\u0440\u043d\u0443\u0442\u044c \u043f\u0440\u043e\u0435\u043a\u0442 ASP.NET core \u0441 \u0448\u0430\u0431\u043b\u043e\u043d\u043e\u043c webapi \u043d\u0430 Ubuntu \u0432 \u0441\u0432\u044f\u0437\u043a\u0435 \u0441 PostgreSQL \u0438 \u043f\u043e\u043b\u043e\u0436\u0438\u0442\u044c \u0432\u0441\u0451 \u0432 docker \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u044b, \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0432 \u0438\u0445 \u0447\u0435\u0440\u0435\u0437 docker-compose.<\/p>\n<h2>\u041d\u0430\u0447\u0430\u043b\u043e<\/h2>\n<p>\u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0430\u043c \u0441\u0442\u043e\u0438\u043b\u043e \u0431\u044b \u0441\u043a\u0430\u0447\u0430\u0442\u044c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0439 \u0431\u0430\u0437\u0438\u0441 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 ASP.NET core \u0438 docker, docker-compose \u0432 \u0441\u0440\u0435\u0434\u0435 Linux \u043f\u043e\u0434 \u043d\u0443\u0436\u043d\u044b\u0439 \u0434\u0438\u0441\u0442\u0440\u0438\u0431\u0443\u0442\u0438\u0432(\u0432 \u043c\u043e\u0451\u043c \u0441\u043b\u0443\u0447\u0430\u0435 Ubuntu). \u041d\u0430 \u044d\u0442\u043e \u0432\u0440\u0435\u043c\u044f \u0442\u0440\u0430\u0442\u0438\u0442\u044c \u043d\u0435 \u0431\u0443\u0434\u0443, \u0442\u0430\u043a \u043a\u0430\u043a \u043d\u0430 \u043f\u0440\u043e\u0441\u0442\u043e\u0440\u0430\u0445 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0430 \u0434\u0430\u043d\u043d\u044b\u0435 \u0442\u0435\u043c\u044b \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u043e\u043f\u0438\u0441\u0430\u043d\u044b. <\/p>\n<details class=\"spoiler\">\n<summary>\u041f\u043e\u043b\u0435\u0437\u043d\u044b\u0439 \u0441\u0441\u044b\u043b\u043a\u0438<\/summary>\n<div class=\"spoiler__content\">\n<ul>\n<li>\n<p><a href=\"https:\/\/timeweb.cloud\/tutorials\/docker\/kak-ustanovit-docker-na-ubuntu-22-04\" rel=\"noopener noreferrer nofollow\">https:\/\/timeweb.cloud\/tutorials\/docker\/kak-ustanovit-docker-na-ubuntu-22-04<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/timeweb.cloud\/tutorials\/docker\/kak-ustanovit-docker-na-ubuntu-22-04\" rel=\"noopener noreferrer nofollow\">https:\/\/timeweb.cloud\/tutorials\/docker\/kak-ustanovit-docker-na-ubuntu-22-04<\/a><\/p>\n<\/li>\n<\/ul>\n<\/div>\n<\/details>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e \u043a\u0430\u043a \u0432\u0441\u0451 \u0441\u043a\u0430\u0447\u0430\u043b\u0438 \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u043b\u0438 \u043d\u0430 \u0440\u0430\u0431\u043e\u0442\u043e\u0441\u043f\u043e\u0441\u043e\u0431\u043d\u043e\u0441\u0442\u044c: <code>docker -v &amp; docker-compose -v &amp; dotnet --info<\/code>, \u043c\u043e\u0436\u0435\u043c \u043f\u0440\u0438\u0441\u0442\u0443\u043f\u0430\u0442\u044c \u043a \u0440\u0430\u0431\u043e\u0442\u0435. <\/p>\n<h2>\u0413\u043b\u0430\u0432\u0430 1<\/h2>\n<figure class=\"float\"><\/figure>\n<p>\u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0434\u0438\u0440\u0435\u043a\u0442\u0440\u0438\u044e \u0438 \u0432\u043b\u043e\u0436\u0438\u043c \u0432 \u043d\u0435\u0451 \u0444\u0430\u0439\u043b docker-compose.yml \u0438 \u043f\u0430\u043f\u043a\u0443. \u042f \u0440\u0430\u0431\u043e\u0442\u0430\u044e \u0432 VS code \u0438 \u0434\u0430\u043d\u043d\u0430\u044f \u0438\u0441\u0442\u043e\u0440\u0438\u044f \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c.<\/p>\n<figure class=\"float bordered\">\n<div><figcaption><strong><u>\u0418\u0442\u043e\u0433\u043e\u0432\u044b\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a<\/u><\/strong><\/figcaption><\/div>\n<\/figure>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0447\u0435\u0433\u043e \u043e\u0442\u043a\u0440\u043e\u0435\u043c \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b \u0438 \u043f\u0435\u0440\u0435\u0439\u0434\u0451\u043c \u043f\u043e \u043f\u0443\u0442\u0438 \u0432 \u043d\u0430\u0448\u0443 \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u0443\u044e \u043f\u0430\u043f\u043a\u0443(\u0432 \u043c\u043e\u0451\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u044d\u0442\u043e <code>cd .\/app<\/code>). \u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u043c\u0430\u043d\u0434\u044b <code>dotnet -h<\/code> \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043a\u0430\u043a\u0438\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u043d\u0430\u043c \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b. \u0422\u0430\u043a \u043a\u0430\u043a \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0440\u0430\u0437\u0432\u0435\u0440\u043d\u0443\u0442\u044c \u043f\u0440\u043e\u0435\u043a\u0442, \u043c\u044b \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u043c <code>new<\/code>. \u0427\u0442\u043e\u0431\u044b \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u043a\u0430\u043a\u0438\u0435 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u043f\u0438\u0441\u0430\u0442\u044c, \u043f\u0440\u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c <code>dotnet new -h<\/code>, \u043f\u043e\u0441\u043b\u0435 \u0447\u0435\u0433\u043e \u0432\u0438\u0434\u0438\u043c, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043a\u0430\u043a\u0438\u0435 \u0448\u0430\u0431\u043b\u043e\u043d\u044b \u0443 \u043d\u0430\u0441 \u0438\u043c\u0435\u044e\u0442\u0441\u044f, \u043c\u043e\u0436\u0435\u043c <\/p>\n<p>\u043f\u0440\u043e\u043f\u0438\u0441\u0430\u0442\u044c <code>dotnet new list.<\/code> \u041e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0432\u0448\u0438\u0441\u044c \u0441 \u0448\u0430\u0431\u043b\u043e\u043d\u043e\u043c \u043f\u0440\u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c <code>dotnet new (\u0432 \u043c\u043e\u0451\u043c \u0441\u043b\u0443\u0447\u0430\u0435: webapi) --no-https -controllers<\/code>. <em>\u0417\u0430\u043c\u0435\u0442\u0438\u043c, \u0447\u0442\u043e \u0432\u0441\u0435 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c, \u043f\u0440\u043e\u043f\u0438\u0441\u0430\u0432 <\/em><code>-h<\/code><strong><em>,<\/em><\/strong><em> \u0447\u0442\u043e \u043a\u0430\u0441\u0430\u0435\u0442\u0441\u044f \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e dotnet.<\/em><\/p>\n<figure class=\"float bordered\"><\/figure>\n<p>\u0417\u0430\u043f\u0443\u0441\u0442\u0438\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u043c \u0440\u0430\u0431\u043e\u0442\u043e\u0441\u043f\u043e\u0441\u043e\u0431\u043d\u043e\u0441\u0442\u044c. \u041d\u0430\u043f\u0438\u0448\u0435\u043c \u043a\u043e\u043c\u0430\u043d\u0434\u0443 <code>dotnet run<\/code> \u0438 \u0432 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u0435 \u0432\u044b\u0432\u0435\u0434\u0435\u0442\u0441\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435.\u041c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u043e\u0441\u043f\u043e\u0441\u043e\u0431\u043d\u043e\u0441\u0442\u044c, \u0437\u0430\u0439\u0434\u044f \u043f\u043e url, \u043d\u043e \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u043c \u0434\u0430\u043b\u044c\u0448\u0435.<\/p>\n<h2>\u0413\u043b\u0430\u0432\u0430 2<\/h2>\n<figure class=\"float bordered\"><\/figure>\n<p>\u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0432 \u0433\u043b\u0430\u0432\u043d\u043e\u0439 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 \u043f\u0430\u043f\u043a\u0443 docker. \u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0432 \u044d\u0442\u043e\u0439 \u043f\u0430\u043f\u043a\u0435 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435: <strong>dotnet, nginx, bd<\/strong>. \u041f\u0430\u043f\u043a\u0430 <strong>dotnet<\/strong> \u0434\u043b\u044f \u0434\u043e\u043a\u0435\u0440\u0444\u0430\u0439\u043b\u043e\u0432 \u0438 \u0434\u0440\u0443\u0433\u0438\u0445 \u0441\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0449\u0438\u0445, <strong>bd<\/strong> \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0444\u0430\u0439\u043b\u044b \u0438\u0437 \u0434\u043e\u043a\u0435\u0440 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 \u0441 \u0434\u0430\u043d\u043d\u043e\u0439 \u043f\u0430\u043f\u043a\u043e\u0439, <strong>nginx<\/strong> \u0434\u043b\u044f \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0430\u0446\u0438\u0438 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0439.<\/p>\n<figure class=\"float bordered\"><\/figure>\n<p>\u041f\u0435\u0440\u0435\u0439\u0434\u0451\u043c \u043a <strong>dockerfile<\/strong> \u0432 \u043f\u0430\u043f\u043a\u0435 <strong>dotnet <\/strong>\u0438 \u043f\u0440\u043e\u043f\u0438\u0448\u0435\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435 \u043f\u043e \u0436\u0435\u043b\u0430\u043d\u0438\u044e. \u0414\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u0434 \u0432\u0437\u044f\u0442 \u0441 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0439 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438.<\/p>\n<details class=\"spoiler\">\n<summary>\u041a\u0440\u0430\u0442\u043a\u043e \u043f\u0440\u043e\u0431\u0435\u0436\u0438\u043c\u0441\u044f \u043f\u043e \u043a\u043e\u0434\u0443:<\/summary>\n<div class=\"spoiler__content\">\n<ol>\n<li>\n<p>\u0421\u043a\u0430\u0447\u0438\u0432\u0430\u0435\u043c <strong>sdk<\/strong> \u043e\u0431\u0440\u0430\u0437, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f <code>workdir<\/code> \u043d\u0430\u0437\u043d\u0430\u0447\u0430\u0435\u043c \u043f\u0430\u043f\u043a\u0443 <strong>source<\/strong> \u0432 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0435 \u043a\u0430\u043a \u043f\u0430\u043f\u043a\u0443 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e.<\/p>\n<\/li>\n<li>\n<p>\u041a\u043e\u043f\u0438\u0440\u0443\u0435\u043c \u043f\u0440\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0435 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 \u0444\u0430\u0439\u043b\u044b .sln \u0438 .csproj. \u0438 \u043f\u0430\u043f\u043a\u0443 \u0441 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u043c.<\/p>\n<\/li>\n<li>\n<p>\u041d\u0430\u0437\u043d\u0430\u0447\u0430\u0435\u043c \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u043f\u0430\u043f\u043a\u0443 \u0441 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u043c.<\/p>\n<\/li>\n<li>\n<p>\u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c restore, \u0447\u0442\u043e\u0431\u044b \u0437\u0430\u0441\u0443\u043d\u0443\u0442\u044c \u0432 \u043a\u044d\u0448 \u043d\u0435\u0438\u0437\u043c\u0435\u043d\u044f\u0435\u043c\u044b\u0435 \u0444\u0430\u0439\u043b\u044b.<\/p>\n<\/li>\n<li>\n<p>\u041f\u0443\u0431\u043b\u0438\u043a\u0443\u0435\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435<\/p>\n<\/li>\n<li>\n<p>\u0421\u043a\u0430\u0447\u0438\u0432\u0430\u0435\u043c \u043e\u0431\u0440\u0430\u0437 \u0441 runtime etc.<\/p>\n<\/li>\n<li>\n<p>\u0417\u0430\u0434\u0430\u0451\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f \u043f\u043e \u0436\u0435\u043b\u0430\u043d\u0438\u044e.<\/p>\n<\/li>\n<li>\n<p>\u041d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c \u043f\u0430\u043f\u043a\u0443 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e.<\/p>\n<\/li>\n<li>\n<p>\u041a\u043e\u043f\u0438\u0440\u0443\u0435\u043c \u043f\u0430\u043f\u043a\u0443 \u0441 \u043e\u0431\u0440\u0430\u0437\u0430 \u0432\u044b\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u043a\u0430\u043a <strong>build.<\/strong><\/p>\n<\/li>\n<li>\n<p>\u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u043a\u0440\u043e\u0441\u0441\u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435\u043d\u043d\u044b\u0439 \u0444\u0430\u0439\u043b.<\/p>\n<\/li>\n<\/ol>\n<\/div>\n<\/details>\n<details class=\"spoiler\">\n<summary>\u041f\u043e\u043b\u0435\u0437\u043d\u044b\u0439 \u0441\u0441\u044b\u043b\u043a\u0438<\/summary>\n<div class=\"spoiler__content\">\n<ul>\n<li>\n<p><a href=\"https:\/\/docs.docker.com\/engine\/reference\/commandline\/build\/\" rel=\"noopener noreferrer nofollow\">https:\/\/docs.docker.com\/engine\/reference\/commandline\/build\/<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/www.baeldung.com\/ops\/dockerfile-run-cmd-entrypoint\" rel=\"noopener noreferrer nofollow\">https:\/\/www.baeldung.com\/ops\/dockerfile-run-cmd-entrypoint<\/a><\/p>\n<\/li>\n<\/ul>\n<\/div>\n<\/details>\n<p><u>\u041d\u0430\u0441\u0442\u0440\u043e\u0438\u043c \u0444\u0430\u0439\u043b docker-compose<\/u><\/p>\n<figure class=\"\"><\/figure>\n<details class=\"spoiler\">\n<summary>\u041a\u0440\u0430\u0442\u043a\u043e \u043f\u0440\u043e\u0431\u0435\u0436\u0438\u043c\u0441\u044f \u043f\u043e \u043a\u043e\u0434\u0443<\/summary>\n<div class=\"spoiler__content\">\n<ol>\n<li>\n<p>\u0423\u043a\u0430\u0436\u0435\u043c \u0432\u0435\u0440\u0441\u0438\u044e<\/p>\n<\/li>\n<li>\n<p>\u0420\u0430\u0437\u0431\u0435\u0440\u0451\u043c\u0441\u044f \u0441\u043e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043e\u0439 \u043a\u0430\u0436\u0434\u043e\u0433\u043e image: <\/p>\n<ol>\n<li>\n<p><strong>image<\/strong> \u0438\u043b\u0438 build &#8212; \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u043e\u0442\u043a\u0443\u0434\u0430 \u0431\u0443\u0434\u0435\u0442 \u0441\u0442\u0440\u043e\u0438\u0442\u044c\u0441\u044f \u043e\u0431\u0440\u0430\u0437<\/p>\n<\/li>\n<li>\n<p><strong>volumes<\/strong> &#8212; \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0430\u0446\u0438\u044f \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0445 \u0444\u0430\u0439\u043b\u043e\u0432, \u043f\u0430\u043f\u043e\u043a \u0438 \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0445 \u0438\u043c<\/p>\n<\/li>\n<li>\n<p><strong>depends_on<\/strong> \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0441\u044f \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u044b\u0439 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440<\/p>\n<\/li>\n<li>\n<p><strong>environment<\/strong> &#8212; \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0441\u0440\u0435\u0434\u044b \u0434\u043b\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0442\u043e\u0433\u043e \u0438\u043b\u0438 \u0438\u043d\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0432\u043d\u0443\u0442\u0440\u0438 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430<\/p>\n<\/li>\n<li>\n<p><strong>ports<\/strong> &#8212; \u043f\u0440\u043e\u043a\u0438\u0434\u044b\u0432\u0430\u0435\u043c \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0435 \u043f\u043e\u0440\u0442\u044b \u0434\u043e\u043a\u0435\u0440 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u043e\u0432 \u0432\u043e \u0432\u043d\u0435\u0448\u043d\u0438\u0435 <\/p>\n<\/li>\n<li>\n<p><strong>networks<\/strong> &#8212; \u0441\u0435\u0442\u044c \u043f\u043e \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043d\u0430\u0448\u0438 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u044b \u0431\u0443\u0434\u0443\u0442 \u043e\u0431\u0449\u0430\u0442\u044c\u0441\u044f<\/p>\n<ol>\n<li>\n<p><strong>ipam<\/strong> \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 ip \u0430\u0434\u0440\u0435\u0441\u0430<\/p>\n<\/li>\n<li>\n<p><strong>driver default<\/strong> &#8212; bridge<\/p>\n<\/li>\n<li>\n<p><strong>config subnet<\/strong> \u0438 <strong>gateway<\/strong>&#8212; \u043c\u0430\u0441\u043a\u0430 \u043f\u043e\u0434\u0441\u0435\u0442\u0438 \u0438 \u0441\u0435\u0442\u0435\u0432\u043e\u0439 \u0448\u043b\u044e\u0437<\/p>\n<\/li>\n<\/ol>\n<\/li>\n<\/ol>\n<\/li>\n<\/ol>\n<p>\u041d\u043e \u0432\u0441\u0451 \u044d\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c \u0443\u043a\u0430\u0437\u0430\u0432 \u0441\u0435\u0442\u044c bridge<\/p>\n<\/div>\n<\/details>\n<p><u>\u041d\u0430\u0441\u0442\u0440\u043e\u0435\u043c \u0444\u0430\u0439\u043b nginx<\/u><\/p>\n<figure class=\"full-width\"><\/figure>\n<details class=\"spoiler\">\n<summary>\u041a\u0440\u0430\u0442\u043a\u043e \u043f\u0440\u043e\u0431\u0435\u0436\u0438\u043c\u0441\u044f \u043f\u043e \u043a\u043e\u0434\u0443<\/summary>\n<div class=\"spoiler__content\">\n<ol>\n<li>\n<\/li>\n<\/ol>\n<\/div>\n<\/details>\n<details class=\"spoiler\">\n<summary>\u041f\u043e\u043b\u0435\u0437\u043d\u044b\u0439 \u0441\u0441\u044b\u043b\u043a\u0438<\/summary>\n<div class=\"spoiler__content\">\n<ul>\n<li>\n<p><a href=\"https:\/\/nginx.org\/en\/docs\/http\/ngx_http_upstream_module.html\" rel=\"noopener noreferrer nofollow\">https:\/\/nginx.org\/en\/docs\/http\/ngx_http_upstream_module.html<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/learn.microsoft.com\/ru-ru\/aspnet\/core\/host-and-deploy\/linux-nginx?view=aspnetcore-8.0&amp;tabs=linux-ubuntu\" rel=\"noopener noreferrer nofollow\">https:\/\/learn.microsoft.com\/ru-ru\/aspnet\/core\/host-and-deploy\/linux-nginx?view=aspnetcore-8.0&amp;tabs=linux-ubuntu<\/a><\/p>\n<\/li>\n<\/ul>\n<\/div>\n<\/details>\n<h2>\u0413\u043b\u0430\u0432\u0430 3<\/h2>\n<p>\u041f\u043e\u0441\u043b\u0435 \u043f\u0440\u043e\u0434\u0435\u043b\u0430\u043d\u043d\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u044b \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u043c\u0441\u044f \u0432 \u043d\u0430\u0448\u0443 \u043f\u0430\u043f\u043a\u0443 \u0441 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u043c cd app \u0438 \u0432 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u0435 \u0443\u043a\u0430\u0436\u0435\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043a\u043e\u0434 dotnet add package Npgsql.EntityFrameworkCore.PostgreSQL &#8212;version 8.0.0\u044d\u0442\u043e\u0442 \u043f\u0430\u043a\u0435\u0442 \u0441\u043b\u0443\u0436\u0438\u0442 \u0434\u043b\u044f \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0441 PostgreSQL. \u0422\u0430\u043a\u0436\u0435 \u043d\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 EF core, \u0438 \u0432 \u044d\u0442\u043e\u043c \u043d\u0430\u043c \u043f\u043e\u043c\u043e\u0436\u0435\u0442  \u043a\u043e\u043c\u0430\u043d\u0434\u0430 dotnet tool install &#8212;global dotnet-ef.<\/p>\n<figure class=\"full-width\">\n<div><figcaption><strong>\u041f\u0440\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u0439 \u043f\u0430\u043a\u0435\u0442 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u0435<\/strong><code> dotnet list package <\/code><\/figcaption><\/div>\n<\/figure>\n<figure class=\"full-width\">\n<div><figcaption><strong>\u041f\u0440\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u0435<\/strong> <code>dotnet tool list -g<\/code><\/figcaption><\/div>\n<\/figure>\n<p>\u0420\u0430\u043d\u043d\u0435\u0435 \u043c\u044b \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u043b\u0438 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u044b \u0441 \u0431\u0434 \u043f\u043e \u043f\u043e\u0440\u0442\u0443 54332 \u0438 adminer \u043f\u043e \u043f\u043e\u0440\u0442\u0443 8080. \u0417\u0430\u0439\u0434\u044f \u043f\u043e <code>http:\/\/localhost:8080\/<\/code> \u043d\u0430\u043c \u043e\u0442\u043a\u0440\u043e\u0435\u0442\u0441\u044f \u043f\u0430\u043d\u0435\u043b\u044c \u0434\u043b\u044f \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0431\u0434. \u0412\u0432\u043e\u0434\u0438\u043c \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u0444\u043e\u0440\u043c\u0443, \u043f\u043e\u0441\u043b\u0435 \u0447\u0435\u0433\u043e \u043d\u0430\u0441 \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0438\u0442 \u0432 \u0430\u0434\u043c\u0438\u043d \u043f\u0430\u043d\u0435\u043b\u044c. \u0422\u0430\u043a\u0436\u0435 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0431\u0434 \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u043f\u043b\u0430\u0433\u0438\u043d\u0443 <strong>vs code Database <\/strong>\u0438\u043b\u0438 \u0436\u0435 \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f <strong>pgAdmin. <\/strong><\/p>\n<figure class=\"float bordered\">\n<div><figcaption><strong>cat.cs<\/strong><\/figcaption><\/div>\n<\/figure>\n<p>\u0422\u0430\u043a \u043a\u0430\u043a \u0432 \u0431\u0434 \u043f\u0443\u0441\u0442\u043e, \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u043c. \u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0444\u0430\u0439\u043b \u0432 \u043f\u0430\u043f\u043a\u0435 <strong>app: context.cs<\/strong> \u0438 <strong>cat.cs<\/strong> \u0438 \u0437\u0430\u043f\u043e\u043b\u043d\u0438\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043a\u043e\u0434\u043e\u043c<\/p>\n<figure class=\"full-width\">\n<div><figcaption>context.cs<\/figcaption><\/div>\n<\/figure>\n<p>\u0422\u0430\u043a \u043a\u0430\u043a \u043c\u044b \u043d\u0435 \u0443\u043a\u0430\u0437\u0430\u043b\u0438 host \u0432 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u0445 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 <strong>PostgreSQL, <\/strong>\u0442\u043e \u043e\u043d \u043d\u0430\u043c \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u043f\u043e \u0434\u0435\u0444\u043e\u043b\u0442\u043d\u043e\u043c\u0443 \u0445\u043e\u0441\u0442\u0443 <strong>localhost. <\/strong>\u0422\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u044e. \u0418\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u043c \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0438 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <code>dotnet ef migrations add initia<\/code> \u0438 <code>dotnet ef database update.<\/code>\u0422\u0435\u043f\u0435\u0440\u044c \u0437\u0430\u0439\u0434\u044f \u0432 \u043d\u0430\u0448\u0443 \u0441\u0440\u0435\u0434\u0443 \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u043c\u044b \u0443\u0432\u0438\u0434\u0438\u043c, \u0447\u0442\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u043b\u0430\u0441\u044c \u0442\u0430\u0431\u043b\u0438\u0446\u0430 <strong>Cats. <\/strong><\/p>\n<figure class=\"full-width\"><\/figure>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043e\u0431\u0440\u0430\u0449\u0430\u0442\u044c\u0441\u044f \u0432 controllers \u043a \u0431\u0434. <\/p>\n<figure class=\"full-width\">\n<div><figcaption> <\/figcaption><\/div>\n<\/figure>\n<figure class=\"float bordered\">\n<div><figcaption>  <\/figcaption><\/div>\n<\/figure>\n<p>\u041e\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u044b, \u0443\u0434\u0430\u043b\u044f\u0435\u043c \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 \u0441 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u043c. \u041f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043c \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u044b, \u0442\u0430\u043a \u043a\u0430\u043a \u043c\u044b \u0442\u043e\u043b\u044c\u043a\u043e \u0443\u043f\u0430\u043a\u043e\u0432\u044b\u0432\u0430\u0435\u043c \u0433\u043e\u0442\u043e\u0432\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435.   \u041f\u043e \u0430\u0434\u0440\u0435\u0441\u0443 <code>http:\/\/api.prop.loc\/Cat<\/code> \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0441\u0434\u0435\u043b\u0430\u0442\u044c get \u0437\u0430\u043f\u0440\u043e\u0441 \u043d\u0430 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0438 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u043a\u043e\u0442\u0438\u043a\u0430. \u0427\u0442\u043e\u0431\u044b \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437 \u043d\u0435 \u0443\u0434\u0430\u043b\u044f\u0442\u044c \u0438 \u043d\u0435 \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u044b, \u043f\u0440\u0438 \u0436\u0435\u043b\u0430\u043d\u0438\u0438 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u0440\u043e\u043f\u0438\u0441\u0430\u0442\u044c <strong>volumes<\/strong>, \u043d\u043e \u044d\u0442\u043e \u0434\u0440\u0443\u0433\u0430\u044f \u0438\u0441\u0442\u043e\u0440\u0438\u044f.<\/p>\n<p>\u0412\u043e\u0442 \u0442\u0430\u043a \u043f\u0440\u043e\u0441\u0442\u043e \u0438 \u0440\u0430\u0437\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0435\u043a\u0442 <strong>ASP.NET core<\/strong> \u0432 \u0441\u0440\u0435\u0434\u0435 <strong>Ubuntu<\/strong> \u0432 \u0441\u0432\u044f\u0437\u043a\u0435 \u0441 <strong>PostgreSQL <\/strong>\u0438 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u0439 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0438\u0437\u0430\u0446\u0438\u0435\u0439 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435 <strong>nginx<\/strong> + <strong>kestrel<\/strong>, \u0438 <strong>\u043a\u043e\u0442\u0438\u043a\u0430\u043c\u0438<\/strong>.<\/p>\n<h2>\u0411\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044e, \u0447\u0442\u043e \u0434\u043e\u0447\u0438\u0442\u0430\u043b\u0438 \u0434\u0430\u043d\u043d\u0443\u044e \u0441\u0442\u0430\u0442\u044c\u044e<\/h2>\n<details class=\"spoiler\">\n<summary>\u0427\u0430\u0441\u0442\u044b\u0435 \u043e\u0448\u0438\u0431\u043a\u0438<\/summary>\n<div class=\"spoiler__content\">\n<details class=\"spoiler\">\n<summary>EF core error<\/summary>\n<div class=\"spoiler__content\">\n<p><code>You must install .NET to run this application.App: \/home\/danis\/.dotnet\/tools\/dotnet-ef Architecture: x64 App host version: 8.0.0 .NET location: Not foundLearn more: https:\/\/aka.ms\/dotnet\/app-launch-failedDownload the .NET runtime: https:\/\/aka.ms\/dotnet-core-applaunch?missing_runtime=true&amp;arch=x64&amp;rid=linux-x64&amp;os=ubuntu.22.04&amp;apphost_version=8.0.0<\/code><\/p>\n<p>\u0414\u0430\u043d\u043d\u0443\u044e \u043e\u0448\u0438\u0431\u043a\u0443 \u043c\u043e\u0436\u043d\u043e \u0440\u0435\u0448\u0438\u0442\u044c, \u043f\u0440\u043e\u043f\u0438\u0441\u0430\u0432 e<code>xport DOTNET_ROOT=\/usr\/share\/dotnet<\/code>(\u043f\u0443\u0442\u044c \u0434\u043e \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f <strong>dotnet<\/strong> \u0441 <strong>sdk<\/strong> \u0438 <strong>runtime(<\/strong>\u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0438\u043d\u0434\u0438\u0432\u0438\u0434\u0443\u0430\u043b\u044c\u043d\u043e)) \u0422\u0430\u043a\u0436\u0435 \u044d\u0442\u0443 \u043f\u0435\u0440\u043c\u0435\u043d\u043d\u0443\u044e \u043c\u043e\u0436\u043d\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u043f\u0440\u0438 \u043a\u0430\u0436\u0434\u043e\u043c \u0432\u0445\u043e\u0434\u0435 \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0443(\u043e\u0442\u0434\u0435\u043b\u044c\u043d\u0430\u044f \u0442\u0435\u043c\u0430).<\/p>\n<\/div>\n<\/details>\n<details class=\"spoiler\">\n<summary>\u0412 \u0441\u043b\u0443\u0447\u0430\u0435, \u0435\u0441\u043b\u0438 \u0432\u044b \u0443\u043a\u0430\u0437\u0430\u043b\u0438 \u0445\u043e\u0441\u0442 \u0432 nginx \u0438 \u043f\u043e \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u043f\u0440\u0438\u0447\u0438\u043d\u0435 \u0443 \u0432\u0430\u0441 \u043d\u0435 \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430<\/summary>\n<div class=\"spoiler__content\">\n<figure class=\"float bordered\"><\/figure>\n<p>\u0422\u043e \u0441\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e \u043d\u0443\u0436\u043d\u043e \u0440\u0430\u0437\u0440\u0435\u0448\u0438\u0442\u044c \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0445\u043e\u0441\u0442\u0430 \u0434\u043e\u0441\u0442\u0443\u043f \u0447\u0435\u0440\u0435\u0437 sudo nano \/etc\/hosts<\/p>\n<\/div>\n<\/details>\n<details class=\"spoiler\">\n<summary>\u0412 \u0441\u043b\u0443\u0447\u0430\u0435, \u0435\u0441\u043b\u0438 \u0432\u044b \u0434\u0435\u043b\u0430\u0435\u0442\u0435 docker-compose up \u0438 docker \u0432\u044b\u0434\u0430\u0451\u0442 \u043e\u0448\u0438\u0431\u043a\u0443 \u043f\u043e \u0442\u0438\u043f\u0443: permission denied while trying to connect to the Docker daemon socket at unix:\/\/\/var\/run\/docker.sock: Get &#171;http:\/\/%2Fvar%2Frun%2Fdocker.sock\/v1.24\/containers\/json?all=1&amp;filters=%7B%22label%22%3A%7B%22com.docker.compose.config-hash%22%3Atrue%2C%22com.docker.compose.project%3Dproject%22%3Atrue%7D%7D&#187;: dial unix \/var\/run\/docker.sock: connect: permission denied<\/summary>\n<div class=\"spoiler__content\">\n<p>\u0421\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e \u0432\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u043f\u0440\u043e\u043f\u0438\u0441\u0430\u0442\u044c \u043f\u0435\u0440\u0435\u0434 docker &#171;sudo&#187;<\/p>\n<\/div>\n<\/details>\n<\/div>\n<\/details>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/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\/articles\/780952\/\"> https:\/\/habr.com\/ru\/articles\/780952\/<\/a><br \/><\/br><\/br><\/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-363055","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/363055","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=363055"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/363055\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=363055"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=363055"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=363055"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}