{"id":18311,"date":"2022-02-25T18:25:18","date_gmt":"2022-02-25T09:25:18","guid":{"rendered":"https:\/\/itport.cloud\/?p=18311"},"modified":"2022-02-25T18:25:18","modified_gmt":"2022-02-25T09:25:18","slug":"post-18311","status":"publish","type":"post","link":"https:\/\/itport.cloud\/?p=18311","title":{"rendered":"Visual Studio\u3067DockerCompose\u3092\u4f7f\u3063\u3066\u958b\u767a\u3057\u3066\u307f\u308b"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\" id=\"e79baee6aca1-1\">\u76ee\u6b21<\/h2>\n\n\n\n<p><a href=\"#topic1\">\u306f\u3058\u3081\u306b<\/a><br><a href=\"#topic2\" data-type=\"internal\" data-id=\"#topic2\">\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306e\u4f5c\u6210<\/a><br><a href=\"#topic3\">Entity Framework Core\u3092\u4f7f\u3063\u3066\u4e8b\u524d\u6e96\u5099 <\/a><br><a href=\"#topic4\">Docker Compose\u306e\u8a2d\u5b9a <\/a><br><a href=\"#topic5\">\u52d5\u4f5c\u78ba\u8a8d<\/a><br><a href=\"#topic6\">\u7d42\u308f\u308a<\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"topic1\">\u306f\u3058\u3081\u306b<\/h2>\n\n\n\n<p>\u6700\u8fd1\u3001Visual Studio\u3067 .Net 5 \u3092\u4f7f\u3063\u305f\u958b\u767a\u306b\u643a\u308f\u308b\u3053\u3068\u304c\u3042\u308a\u3001Docker\u3092\u4f7f\u3063\u3066\u30c7\u30d0\u30c3\u30b0\u3092\u3057\u3066\u304a\u308a\u307e\u3057\u305f\u3002<br>\u305d\u306e\u6642\u306bDB\u304c\u5fc5\u8981\u3067\u3001\u51fa\u6765\u308c\u3070DB\u3082 Docker \u3092\u4f7f\u3044\u305f\u3044\u3068\u601d\u3044\u8abf\u3079\u3066\u3044\u305f\u3068\u3053\u308d\u3001Visual Studio\u306e\u6a5f\u80fd\u3067\u30c7\u30d0\u30c3\u30b0\u7528\u306b Docker \u3067DB\u3082\u4f7f\u3048\u308b\u3053\u3068\u304c\u5206\u304b\u3063\u305f\u306e\u3067\u305d\u3061\u3089\u3092\u8a18\u4e8b\u306b\u3057\u3088\u3046\u3068\u601d\u3044\u307e\u3059\u3002<br><br>\u74b0\u5883\u306f\u4ee5\u4e0b\u3067\u884c\u3044\u307e\u3059\u3002\uff08\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u624b\u9806\u306f\u7701\u304d\u307e\u3059\uff09<br><br>\u74b0\u5883<br>Windows10<br>Visual Studio 2019 Enterprise<br>Docker 4.4.4<br>.Net 5<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"topic2\"> \u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306e\u4f5c\u6210<\/h2>\n\n\n\n<p>\u307e\u305a\u30c6\u30b9\u30c8\u7528\u306e\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<br>\u4eca\u56de\u306fAsp.Net Core MVC\u3067\u4f5c\u308a\u307e\u3059\u3002<br>\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u540d\u306f\u300cDockerComposeTest\u300d\u306b\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"545\" src=\"https:\/\/itport.cloud\/wp-content\/uploads\/2022\/02\/2022-02-21_09h38_46-1024x545.png\" alt=\"\" class=\"wp-image-18315\" srcset=\"https:\/\/itport.cloud\/wp-content\/uploads\/2022\/02\/2022-02-21_09h38_46-1024x545.png 1024w, https:\/\/itport.cloud\/wp-content\/uploads\/2022\/02\/2022-02-21_09h38_46-300x160.png 300w, https:\/\/itport.cloud\/wp-content\/uploads\/2022\/02\/2022-02-21_09h38_46-768x409.png 768w, https:\/\/itport.cloud\/wp-content\/uploads\/2022\/02\/2022-02-21_09h38_46-450x240.png 450w, https:\/\/itport.cloud\/wp-content\/uploads\/2022\/02\/2022-02-21_09h38_46-900x479.png 900w, https:\/\/itport.cloud\/wp-content\/uploads\/2022\/02\/2022-02-21_09h38_46.png 1440w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p><br>\u6b21\u306bDocker \u30b3\u30f3\u30c6\u30ca\u3067\u30c7\u30d0\u30c3\u30b0\u3092\u3057\u305f\u3044\u306e\u3067\u300cDocker\u3092\u6709\u52b9\u306b\u3059\u308b\u300d\u306b\u30c1\u30a7\u30c3\u30af\u3092\u5165\u308c\u307e\u3059\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"545\" src=\"https:\/\/itport.cloud\/wp-content\/uploads\/2022\/02\/2022-02-21_09h38_54-1024x545.png\" alt=\"\" class=\"wp-image-18316\" srcset=\"https:\/\/itport.cloud\/wp-content\/uploads\/2022\/02\/2022-02-21_09h38_54-1024x545.png 1024w, https:\/\/itport.cloud\/wp-content\/uploads\/2022\/02\/2022-02-21_09h38_54-300x160.png 300w, https:\/\/itport.cloud\/wp-content\/uploads\/2022\/02\/2022-02-21_09h38_54-768x409.png 768w, https:\/\/itport.cloud\/wp-content\/uploads\/2022\/02\/2022-02-21_09h38_54-450x240.png 450w, https:\/\/itport.cloud\/wp-content\/uploads\/2022\/02\/2022-02-21_09h38_54-900x479.png 900w, https:\/\/itport.cloud\/wp-content\/uploads\/2022\/02\/2022-02-21_09h38_54.png 1440w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u304c\u4f5c\u6210\u3055\u308c\u308b\u306e\u3067\u3001\u307e\u305a\u306f\u30c7\u30d0\u30c3\u30b0\u3092\u3057\u3066\u30da\u30fc\u30b8\u304c\u8868\u793a\u3055\u308c\u308b\u304b\u3092\u78ba\u8a8d\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"576\" src=\"https:\/\/itport.cloud\/wp-content\/uploads\/2022\/02\/2022-02-21_09h34_20-1024x576.png\" alt=\"\" class=\"wp-image-18317\" srcset=\"https:\/\/itport.cloud\/wp-content\/uploads\/2022\/02\/2022-02-21_09h34_20-1024x576.png 1024w, https:\/\/itport.cloud\/wp-content\/uploads\/2022\/02\/2022-02-21_09h34_20-300x169.png 300w, https:\/\/itport.cloud\/wp-content\/uploads\/2022\/02\/2022-02-21_09h34_20-768x432.png 768w, https:\/\/itport.cloud\/wp-content\/uploads\/2022\/02\/2022-02-21_09h34_20-1536x864.png 1536w, https:\/\/itport.cloud\/wp-content\/uploads\/2022\/02\/2022-02-21_09h34_20-450x253.png 450w, https:\/\/itport.cloud\/wp-content\/uploads\/2022\/02\/2022-02-21_09h34_20-900x506.png 900w, https:\/\/itport.cloud\/wp-content\/uploads\/2022\/02\/2022-02-21_09h34_20.png 1920w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>\u4ee5\u4e0b\u306e\u30da\u30fc\u30b8\u304c\u8868\u793a\u3055\u308c\u308c\u3070OK\u3067\u3059\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"505\" src=\"https:\/\/itport.cloud\/wp-content\/uploads\/2022\/02\/2022-02-21_09h35_03-1024x505.png\" alt=\"\" class=\"wp-image-18318\" srcset=\"https:\/\/itport.cloud\/wp-content\/uploads\/2022\/02\/2022-02-21_09h35_03-1024x505.png 1024w, https:\/\/itport.cloud\/wp-content\/uploads\/2022\/02\/2022-02-21_09h35_03-300x148.png 300w, https:\/\/itport.cloud\/wp-content\/uploads\/2022\/02\/2022-02-21_09h35_03-768x379.png 768w, https:\/\/itport.cloud\/wp-content\/uploads\/2022\/02\/2022-02-21_09h35_03-1536x758.png 1536w, https:\/\/itport.cloud\/wp-content\/uploads\/2022\/02\/2022-02-21_09h35_03-450x222.png 450w, https:\/\/itport.cloud\/wp-content\/uploads\/2022\/02\/2022-02-21_09h35_03-900x444.png 900w, https:\/\/itport.cloud\/wp-content\/uploads\/2022\/02\/2022-02-21_09h35_03.png 1920w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"topic3\">Entity Framework Core\u3092\u4f7f\u3063\u3066\u4e8b\u524d\u6e96\u5099<\/h2>\n\n\n\n<p>\u4eca\u56de\u306fDB\u3092\u4f7f\u3046\u306e\u3067\u3001DB\u306b\u63a5\u7d9a\u3057\u305f\u3068\u3044\u3046\u3053\u3068\u3092\u5206\u304b\u308a\u3084\u3059\u304f\u3059\u308b\u305f\u3081Entity Framework Core\u3092\u4f7f\u3044\u307e\u3059\u3002<br>\u307e\u305a\u306fDbContext\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<br>\u30d5\u30a1\u30a4\u30eb\u540d\u306f\u300cDockerComposeTestDbContext\u300d\u306b\u3057\u307e\u3059\u3002<br>\u4e2d\u8eab\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u4f5c\u6210\u3057\u3066\u304a\u308a\u307e\u3059\u3002<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: csharp; title: ; notranslate\" title=\"\">\n    public class DockerComposeTestDbContext : DbContext\n    {\n        public DockerComposeTestDbContext(DbContextOptions<DockerComposeTestDbContext> options)\n            : base(options)\n        {\n        }\n\n        protected override void OnModelCreating(ModelBuilder modelBuilder)\n        {\n            modelBuilder.Entity<Person>().Property(x => x.Name).IsRequired();\n            base.OnModelCreating(modelBuilder);\n        }\n\n        public DbSet<DockerComposeTest.Models.Person> Person { get; set; }\n    } \n<\/pre><\/div>\n\n\n<p>\u6b21\u306bModel\u304c\u5fc5\u8981\u306a\u306e\u3067\u3001\u300cPerson\u300d\u30e2\u30c7\u30eb\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: csharp; title: ; notranslate\" title=\"\">\n    public class Person\n    {\n        &#x5B;Key]\n        public int Id { get; set; }\n        public string Name { get; set; }\n        public int Age { get; set; }\n    }\n<\/pre><\/div>\n\n\n<p>\u5f8c\u306f\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u3068\u30d3\u30e5\u30fc\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<br>\uff08\u30b9\u30ad\u30e3\u30d5\u30a9\u30fc\u30eb\u30c7\u30a3\u30f3\u30b0\u3092\u4f7f\u3063\u3066\u4f5c\u6210\u3057\u305f\u306e\u3067\u3001\u8a73\u7d30\u306f\u30b9\u30ad\u30e3\u30d5\u30a9\u30fc\u30eb\u30c7\u30a3\u30f3\u30b0\u306a\u3069\u3067\u691c\u7d22\u3057\u3066\u304f\u3060\u3055\u3044\uff09<br>\u3061\u306a\u307f\u306b\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002View\u306f\uff15\u3064\u3042\u308b\u306e\u3067\u3001Index.cshtml\u3068Create.cshtml\u306e\u307f\u8a18\u8f09\u3057\u307e\u3059\u3002<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: csharp; title: ; notranslate\" title=\"\">\npublic class PeopleController : Controller\n    {\n        private readonly DockerComposeTestDbContext _context;\n\n        public PeopleController(DockerComposeTestDbContext context)\n        {\n            _context = context;\n        }\n\n        \/\/ GET: People\n        public async Task<IActionResult> Index()\n        {\n            return View(await _context.Person.ToListAsync());\n        }\n\n        \/\/ GET: People\/Details\/5\n        public async Task<IActionResult> Details(int? id)\n        {\n            if (id == null)\n            {\n                return NotFound();\n            }\n\n            var person = await _context.Person\n                .FirstOrDefaultAsync(m => m.Id == id);\n            if (person == null)\n            {\n                return NotFound();\n            }\n\n            return View(person);\n        }\n\n        \/\/ GET: People\/Create\n        public IActionResult Create()\n        {\n            return View();\n        }\n\n        \/\/ POST: People\/Create\n        \/\/ To protect from overposting attacks, enable the specific properties you want to bind to.\n        \/\/ For more details, see http:\/\/go.microsoft.com\/fwlink\/?LinkId=317598.\n        &#x5B;HttpPost]\n        &#x5B;ValidateAntiForgeryToken]\n        public async Task<IActionResult> Create(&#x5B;Bind(\"Id,Name,Age\")] Person person)\n        {\n            if (ModelState.IsValid)\n            {\n                _context.Add(person);\n                await _context.SaveChangesAsync();\n                return RedirectToAction(nameof(Index));\n            }\n            return View(person);\n        }\n\n        \/\/ GET: People\/Edit\/5\n        public async Task<IActionResult> Edit(int? id)\n        {\n            if (id == null)\n            {\n                return NotFound();\n            }\n\n            var person = await _context.Person.FindAsync(id);\n            if (person == null)\n            {\n                return NotFound();\n            }\n            return View(person);\n        }\n\n        \/\/ POST: People\/Edit\/5\n        \/\/ To protect from overposting attacks, enable the specific properties you want to bind to.\n        \/\/ For more details, see http:\/\/go.microsoft.com\/fwlink\/?LinkId=317598.\n        &#x5B;HttpPost]\n        &#x5B;ValidateAntiForgeryToken]\n        public async Task<IActionResult> Edit(int id, &#x5B;Bind(\"Id,Name,Age\")] Person person)\n        {\n            if (id != person.Id)\n            {\n                return NotFound();\n            }\n\n            if (ModelState.IsValid)\n            {\n                try\n                {\n                    _context.Update(person);\n                    await _context.SaveChangesAsync();\n                }\n                catch (DbUpdateConcurrencyException)\n                {\n                    if (!PersonExists(person.Id))\n                    {\n                        return NotFound();\n                    }\n                    else\n                    {\n                        throw;\n                    }\n                }\n                return RedirectToAction(nameof(Index));\n            }\n            return View(person);\n        }\n\n        \/\/ GET: People\/Delete\/5\n        public async Task<IActionResult> Delete(int? id)\n        {\n            if (id == null)\n            {\n                return NotFound();\n            }\n\n            var person = await _context.Person\n                .FirstOrDefaultAsync(m => m.Id == id);\n            if (person == null)\n            {\n                return NotFound();\n            }\n\n            return View(person);\n        }\n\n        \/\/ POST: People\/Delete\/5\n        &#x5B;HttpPost, ActionName(\"Delete\")]\n        &#x5B;ValidateAntiForgeryToken]\n        public async Task<IActionResult> DeleteConfirmed(int id)\n        {\n            var person = await _context.Person.FindAsync(id);\n            _context.Person.Remove(person);\n            await _context.SaveChangesAsync();\n            return RedirectToAction(nameof(Index));\n        }\n\n        private bool PersonExists(int id)\n        {\n            return _context.Person.Any(e => e.Id == id);\n        }\n    }\n<\/pre><\/div>\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: xml; title: ; notranslate\" title=\"\">\n@model IEnumerable<DockerComposeTest.Models.Person>\n\n@{\n    ViewData&#x5B;\"Title\"] = \"Index\";\n}\n\n<h1 id=\"index-2\">Index<\/h1>\n\n<p>\n    <a asp-action=\"Create\">Create New<\/a>\n<\/p>\n<table class=\"table\">\n    <thead>\n        <tr>\n            <th>\n                @Html.DisplayNameFor(model => model.Name)\n            <\/th>\n            <th>\n                @Html.DisplayNameFor(model => model.Age)\n            <\/th>\n            <th><\/th>\n        <\/tr>\n    <\/thead>\n    <tbody>\n@foreach (var item in Model) {\n        <tr>\n            <td>\n                @Html.DisplayFor(modelItem => item.Name)\n            <\/td>\n            <td>\n                @Html.DisplayFor(modelItem => item.Age)\n            <\/td>\n            <td>\n                <a asp-action=\"Edit\" asp-route-id=\"@item.Id\">Edit<\/a> |\n                <a asp-action=\"Details\" asp-route-id=\"@item.Id\">Details<\/a> |\n                <a asp-action=\"Delete\" asp-route-id=\"@item.Id\">Delete<\/a>\n            <\/td>\n        <\/tr>\n}\n    <\/tbody>\n<\/table>\n\n<\/pre><\/div>\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: xml; title: ; notranslate\" title=\"\">\n@model DockerComposeTest.Models.Person\n\n@{\n    ViewData&#x5B;\"Title\"] = \"Create\";\n}\n\n<h1 id=\"create-3\">Create<\/h1>\n\n<h4 id=\"person-4\">Person<\/h4>\n<hr \/>\n<div class=\"row\">\n    <div class=\"col-md-4\">\n        <form asp-action=\"Create\">\n            <div asp-validation-summary=\"ModelOnly\" class=\"text-danger\"><\/div>\n            <div class=\"form-group\">\n                <label asp-for=\"Name\" class=\"control-label\"><\/label>\n                <input asp-for=\"Name\" class=\"form-control\" \/>\n                <span asp-validation-for=\"Name\" class=\"text-danger\"><\/span>\n            <\/div>\n            <div class=\"form-group\">\n                <label asp-for=\"Age\" class=\"control-label\"><\/label>\n                <input asp-for=\"Age\" class=\"form-control\" \/>\n                <span asp-validation-for=\"Age\" class=\"text-danger\"><\/span>\n            <\/div>\n            <div class=\"form-group\">\n                <input type=\"submit\" value=\"Create\" class=\"btn btn-primary\" \/>\n            <\/div>\n        <\/form>\n    <\/div>\n<\/div>\n\n<div>\n    <a asp-action=\"Index\">Back to List<\/a>\n<\/div>\n\n@section Scripts {\n    @{await Html.RenderPartialAsync(\"_ValidationScriptsPartial\");}\n}\n\n<\/pre><\/div>\n\n\n<p><br>\u307e\u305f\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306b\u4f7f\u7528\u3059\u308bDbContext\u3092\u767b\u9332\u3057\u307e\u3059\u3002<br>\u30b3\u30fc\u30c9\u306fStartup.cs\u30d5\u30a1\u30a4\u30eb\u306b\u8a18\u8f09\u3057\u307e\u3059\u3002<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: csharp; title: ; notranslate\" title=\"\">\n\/\/ This method gets called by the runtime. Use this method to add services to the container.\n        public void ConfigureServices(IServiceCollection services)\n        {\n                     \u30fb\n                     \u30fb\n            services.AddDbContext<DockerComposeTestDbContext>(optioins =>\n            {\n               optioins.UseNpgsql(@\"Host=test_db;Username=postgres;Password=password;Database=postgres\");\n            });\n\n                     \u30fb\n                     \u30fb\n        }\n<\/pre><\/div>\n\n\n<p>\u307e\u305f\u30c6\u30fc\u30d6\u30eb\u3092\u751f\u6210\u3059\u308b\u306e\u304c\u9762\u5012\u306a\u306e\u3067\u3001\u4eca\u56de\u306f\u5b9f\u884c\u6642\u306b\u81ea\u52d5\u3067\u751f\u6210\u3059\u308b\u3088\u3046\u306b\u3057\u307e\u3059\u3002<br>\u3053\u308c\u306fProgram.cs\u306eMain\u95a2\u6570\u306b\u8a18\u8f09\u3057\u307e\u3059\u3002<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: csharp; title: ; notranslate\" title=\"\">\nvar context = services.GetRequiredService<DockerComposeTestDbContext>();\n        public static void Main(string&#x5B;] args)\n        {\n            var host = CreateHostBuilder(args).Build();\n            using (var scope = host.Services.CreateScope())\n            {\n                var services = scope.ServiceProvider;\n                try\n                {\n                    var context = services.GetRequiredService<DockerComposeTestDbContext>();\n                    context.Database.EnsureCreated();\n                    \/\/ DbInitializer.Initialize(context);\n                }\n                catch (Exception ex)\n                {\n                    var logger = services.GetRequiredService<ILogger<Program>>();\n                    logger.LogError(ex, \"An error occurred creating the DB.\");\n                }\n            }\n            host.Run();\n        }\n<\/pre><\/div>\n\n\n<p>\u6700\u5f8c\u306bMigration\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<br>Visual Studio\u306e\u4e2d\u592e\u4e0b\u306b\u3042\u308b\u3068\u3053\u308d\u304b\u3089\u300c\u30d1\u30c3\u30b1\u30fc\u30b8\u30de\u30cd\u30fc\u30b8\u30e3\u30fc\u30b3\u30f3\u30bd\u30fc\u30eb\u300d\u3092\u30af\u30ea\u30c3\u30af\u3057\u307e\u3059<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"560\" src=\"https:\/\/itport.cloud\/wp-content\/uploads\/2022\/02\/2022-02-21_12h22_53-1024x560.png\" alt=\"\" class=\"wp-image-18321\" srcset=\"https:\/\/itport.cloud\/wp-content\/uploads\/2022\/02\/2022-02-21_12h22_53-1024x560.png 1024w, https:\/\/itport.cloud\/wp-content\/uploads\/2022\/02\/2022-02-21_12h22_53-300x164.png 300w, https:\/\/itport.cloud\/wp-content\/uploads\/2022\/02\/2022-02-21_12h22_53-768x420.png 768w, https:\/\/itport.cloud\/wp-content\/uploads\/2022\/02\/2022-02-21_12h22_53-1536x840.png 1536w, https:\/\/itport.cloud\/wp-content\/uploads\/2022\/02\/2022-02-21_12h22_53-450x246.png 450w, https:\/\/itport.cloud\/wp-content\/uploads\/2022\/02\/2022-02-21_12h22_53-900x492.png 900w, https:\/\/itport.cloud\/wp-content\/uploads\/2022\/02\/2022-02-21_12h22_53.png 1920w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>\u305d\u3046\u3059\u308b\u3068\u300cPM&gt;\u300d\u306e\u6b21\u306b\u30b3\u30de\u30f3\u30c9\u304c\u5165\u529b\u3067\u304d\u308b\u306e\u3067\u300cAdd-Migration Initialize\u300d\u3068\u5165\u529b\u3057\u3066Migration\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u3053\u308c\u3067DB\u306b\u95a2\u3059\u308b\u8a18\u8ff0\u306f\u4ee5\u4e0a\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"topic4\">Docker Compose\u306e\u8a2d\u5b9a<\/h2>\n\n\n\n<p>\u6b21\u306bDB\u7528\u306eDocker\u30b3\u30f3\u30c6\u30ca\u3092\u8a2d\u5b9a\u3057\u307e\u3059\u3002<br>\u30bd\u30ea\u30e5\u30fc\u30b7\u30e7\u30f3\u30a8\u30af\u30b9\u30d7\u30ed\u30fc\u30e9\u30fc\u3067\u300c\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3092\u53f3\u30af\u30ea\u30c3\u30af\u300d\u2192\u300c\u8ffd\u52a0\u300d\u2192\u300c\u30b3\u30f3\u30c6\u30ca \u30aa\u30fc\u30b1\u30b9\u30c8\u30ec\u30fc\u30bf\u30fc\u306e\u30b5\u30dd\u30fc\u30c8&#8230;\u300d\u3092\u30af\u30ea\u30c3\u30af\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"560\" src=\"https:\/\/itport.cloud\/wp-content\/uploads\/2022\/02\/2022-02-21_10h05_55-1024x560.png\" alt=\"\" class=\"wp-image-18320\" srcset=\"https:\/\/itport.cloud\/wp-content\/uploads\/2022\/02\/2022-02-21_10h05_55-1024x560.png 1024w, https:\/\/itport.cloud\/wp-content\/uploads\/2022\/02\/2022-02-21_10h05_55-300x164.png 300w, https:\/\/itport.cloud\/wp-content\/uploads\/2022\/02\/2022-02-21_10h05_55-768x420.png 768w, https:\/\/itport.cloud\/wp-content\/uploads\/2022\/02\/2022-02-21_10h05_55-1536x840.png 1536w, https:\/\/itport.cloud\/wp-content\/uploads\/2022\/02\/2022-02-21_10h05_55-450x246.png 450w, https:\/\/itport.cloud\/wp-content\/uploads\/2022\/02\/2022-02-21_10h05_55-900x492.png 900w, https:\/\/itport.cloud\/wp-content\/uploads\/2022\/02\/2022-02-21_10h05_55.png 1920w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>\u305d\u3046\u3059\u308b\u3068\u30c0\u30a4\u30a2\u30ed\u30b0\u304c\u8868\u793a\u3055\u308c\u308b\u306e\u3067\u3001\u30c9\u30ed\u30c3\u30d7\u30c0\u30a6\u30f3\u3092\u300cDocker Compose\u300d\u306b\u3057\u3066\u300cOK\u300d\u3092\u30af\u30ea\u30c3\u30af\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"406\" height=\"118\" src=\"https:\/\/itport.cloud\/wp-content\/uploads\/2022\/02\/2022-02-21_10h08_16.png\" alt=\"\" class=\"wp-image-18322\" srcset=\"https:\/\/itport.cloud\/wp-content\/uploads\/2022\/02\/2022-02-21_10h08_16.png 406w, https:\/\/itport.cloud\/wp-content\/uploads\/2022\/02\/2022-02-21_10h08_16-300x87.png 300w\" sizes=\"auto, (max-width: 406px) 100vw, 406px\" \/><\/figure>\n\n\n\n<p>\u6b21\u306e\u30c0\u30a4\u30a2\u30ed\u30b0\u306f\u300cLinux\u300d\u306e\u307e\u307e\u3067\u300cOK\u300d\u3092\u30af\u30ea\u30c3\u30af\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"366\" height=\"161\" src=\"https:\/\/itport.cloud\/wp-content\/uploads\/2022\/02\/2022-02-21_10h06_35.png\" alt=\"\" class=\"wp-image-18323\" srcset=\"https:\/\/itport.cloud\/wp-content\/uploads\/2022\/02\/2022-02-21_10h06_35.png 366w, https:\/\/itport.cloud\/wp-content\/uploads\/2022\/02\/2022-02-21_10h06_35-300x132.png 300w\" sizes=\"auto, (max-width: 366px) 100vw, 366px\" \/><\/figure>\n\n\n\n<p>\u305d\u3046\u3059\u308b\u3068\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3068\u540c\u3058\u968e\u5c64\u306b\u300cdocker-compose\u300d\u304c\u8868\u793a\u3055\u308c\u307e\u3059\u3002<\/p>\n\n\n\n<p><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"560\" src=\"https:\/\/itport.cloud\/wp-content\/uploads\/2022\/02\/2022-02-21_12h26_38-1024x560.png\" alt=\"\" class=\"wp-image-18324\" srcset=\"https:\/\/itport.cloud\/wp-content\/uploads\/2022\/02\/2022-02-21_12h26_38-1024x560.png 1024w, https:\/\/itport.cloud\/wp-content\/uploads\/2022\/02\/2022-02-21_12h26_38-300x164.png 300w, https:\/\/itport.cloud\/wp-content\/uploads\/2022\/02\/2022-02-21_12h26_38-768x420.png 768w, https:\/\/itport.cloud\/wp-content\/uploads\/2022\/02\/2022-02-21_12h26_38-1536x840.png 1536w, https:\/\/itport.cloud\/wp-content\/uploads\/2022\/02\/2022-02-21_12h26_38-450x246.png 450w, https:\/\/itport.cloud\/wp-content\/uploads\/2022\/02\/2022-02-21_12h26_38-900x492.png 900w, https:\/\/itport.cloud\/wp-content\/uploads\/2022\/02\/2022-02-21_12h26_38.png 1920w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>\u3053\u308c\u3067Docker Compose\u304c\u4f7f\u3048\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f\u3002<br>\u6b21\u306bDocker\u306bDB\u306e\u30b3\u30f3\u30c6\u30ca\u3092\u4f5c\u6210\u3059\u308b\u3088\u3046\u306b\u8a2d\u5b9a\u3057\u307e\u3059\u3002<br>\u4eca\u4f5c\u6210\u3055\u308c\u305f\u300cdocker-compose\u300d\u306e\u76f4\u4e0b\u306b\u3042\u308b\u300cdocker-compose.yml\u300d\u3092\u958b\u304d\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u8a2d\u5b9a\u3057\u307e\u3059\u3002<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: csharp; title: ; notranslate\" title=\"\">\nversion: '3.4'\n\nservices:\n\n  db:\n    image: postgres:13-alpine\n    ports:\n      - \"5434:5432\"\n    environment:\n      TZ: Asia\/Tokyo\n      POSTGRES_DB: postgres\n      POSTGRES_USER: postgres\n      POSTGRES_PASSWORD: password\n      POSTGRES_INITDB_ARGS: \"--encoding=UTF-8\"\n    restart: always\n    hostname: test_db\n\n  dockercomposetest:\n    image: ${DOCKER_REGISTRY-}dockercomposetest\n    build:\n      context: .\n      dockerfile: DockerComposeTest\/Dockerfile\n    depends_on: \n     - db\n<\/pre><\/div>\n\n\n<p>\u3053\u3046\u3059\u308b\u3053\u3068\u3067\u81ea\u52d5\u3067DB\u306edocker\u30b3\u30f3\u30c6\u30ca\u3092\u4f5c\u6210\u3057\u3066\u304f\u308c\u307e\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"topic5\">\u52d5\u4f5c\u78ba\u8a8d<\/h2>\n\n\n\n<p>\u3067\u306f\u5b9f\u969b\u306b\u52d5\u304b\u3057\u3066\u307f\u307e\u3059\u3002<br>Visual Studio\u306e\u4e2d\u592e\u4e0a\u306b\u3042\u308b\u300c\u25b7\u300d\u3092\u30af\u30ea\u30c3\u30af\u3057\u307e\u3059\u3002<br>\u3053\u306e\u6642\u5de6\u306e\u30c9\u30ed\u30c3\u30d7\u30c0\u30a6\u30f3\u304c\u300cdocker-compose\u300d\u306b\u306a\u3063\u3066\u3044\u308b\u304b\u78ba\u8a8d\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"560\" src=\"https:\/\/itport.cloud\/wp-content\/uploads\/2022\/02\/2022-02-21_12h31_19-1024x560.png\" alt=\"\" class=\"wp-image-18325\" srcset=\"https:\/\/itport.cloud\/wp-content\/uploads\/2022\/02\/2022-02-21_12h31_19-1024x560.png 1024w, https:\/\/itport.cloud\/wp-content\/uploads\/2022\/02\/2022-02-21_12h31_19-300x164.png 300w, https:\/\/itport.cloud\/wp-content\/uploads\/2022\/02\/2022-02-21_12h31_19-768x420.png 768w, https:\/\/itport.cloud\/wp-content\/uploads\/2022\/02\/2022-02-21_12h31_19-1536x840.png 1536w, https:\/\/itport.cloud\/wp-content\/uploads\/2022\/02\/2022-02-21_12h31_19-450x246.png 450w, https:\/\/itport.cloud\/wp-content\/uploads\/2022\/02\/2022-02-21_12h31_19-900x492.png 900w, https:\/\/itport.cloud\/wp-content\/uploads\/2022\/02\/2022-02-21_12h31_19.png 1920w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>\u305d\u3046\u3059\u308b\u3068\u30d3\u30eb\u30c9\u304c\u59cb\u307e\u308a\u3001\u554f\u984c\u306a\u3051\u308c\u3070\u30c7\u30d0\u30c3\u30b0\u4e2d\u306b\u306a\u308a\u307e\u3059\u3002<br>\u30d6\u30e9\u30a6\u30b6\u3082\u7acb\u3061\u4e0a\u304c\u308b\u306e\u3067\u3001\u30d6\u30e9\u30a6\u30b6\u306eURL\u306b\u7d9a\u3051\u3066\u300c\/People\u300d\u3068\u5165\u529b\u3057\u307e\u3059\u3002<br>\uff08\u4eca\u56de\u306f\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u540d\u304c\u300cPeopleController\u300d\u306a\u306e\u3067URL\u3082\u300cPeople\u300d\u306b\u3057\u3066\u304a\u308a\u307e\u3059\uff09<br><br>\u554f\u984c\u306a\u3051\u308c\u3070Index\u30da\u30fc\u30b8\u304c\u8868\u793a\u3055\u308c\u307e\u3059\u3002<br>\u5b9f\u969b\u306bDB\u306b\u3064\u306a\u304c\u3063\u3066\u3044\u308b\u304b\u3092\u78ba\u8a8d\u3059\u308b\u305f\u3081\u3001\u300cCreate New\u300d\u3092\u30af\u30ea\u30c3\u30af\u3057\u3066\u30c7\u30fc\u30bf\u3092\u65b0\u898f\u767b\u9332\u3057\u3066\u307f\u307e\u3059\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"576\" src=\"https:\/\/itport.cloud\/wp-content\/uploads\/2022\/02\/2022-02-21_12h33_32-1024x576.png\" alt=\"\" class=\"wp-image-18326\" srcset=\"https:\/\/itport.cloud\/wp-content\/uploads\/2022\/02\/2022-02-21_12h33_32-1024x576.png 1024w, https:\/\/itport.cloud\/wp-content\/uploads\/2022\/02\/2022-02-21_12h33_32-300x169.png 300w, https:\/\/itport.cloud\/wp-content\/uploads\/2022\/02\/2022-02-21_12h33_32-768x432.png 768w, https:\/\/itport.cloud\/wp-content\/uploads\/2022\/02\/2022-02-21_12h33_32-1536x864.png 1536w, https:\/\/itport.cloud\/wp-content\/uploads\/2022\/02\/2022-02-21_12h33_32-450x253.png 450w, https:\/\/itport.cloud\/wp-content\/uploads\/2022\/02\/2022-02-21_12h33_32-900x506.png 900w, https:\/\/itport.cloud\/wp-content\/uploads\/2022\/02\/2022-02-21_12h33_32.png 1920w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>\u5165\u529b\u30c7\u30fc\u30bf\u306fName\u3092\u300cTest2\u300d\u3001Age\u3092\u300c16\u300d\u306b\u3057\u3066\u307f\u307e\u3059\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"505\" src=\"https:\/\/itport.cloud\/wp-content\/uploads\/2022\/02\/2022-02-21_12h34_42-1024x505.png\" alt=\"\" class=\"wp-image-18327\" srcset=\"https:\/\/itport.cloud\/wp-content\/uploads\/2022\/02\/2022-02-21_12h34_42-1024x505.png 1024w, https:\/\/itport.cloud\/wp-content\/uploads\/2022\/02\/2022-02-21_12h34_42-300x148.png 300w, https:\/\/itport.cloud\/wp-content\/uploads\/2022\/02\/2022-02-21_12h34_42-768x379.png 768w, https:\/\/itport.cloud\/wp-content\/uploads\/2022\/02\/2022-02-21_12h34_42-1536x758.png 1536w, https:\/\/itport.cloud\/wp-content\/uploads\/2022\/02\/2022-02-21_12h34_42-450x222.png 450w, https:\/\/itport.cloud\/wp-content\/uploads\/2022\/02\/2022-02-21_12h34_42-900x444.png 900w, https:\/\/itport.cloud\/wp-content\/uploads\/2022\/02\/2022-02-21_12h34_42.png 1920w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>Create\u30dc\u30bf\u30f3\u3092\u30af\u30ea\u30c3\u30af\u3059\u308b\u3068Index\u30da\u30fc\u30b8\u306b\u623b\u308a\u3001\u753b\u9762\u306b\u4eca\u4f5c\u6210\u3057\u305f\u300cTest2\u300d\u304c\u8868\u793a\u3055\u308c\u3066\u3044\u308b\u304b\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"505\" src=\"https:\/\/itport.cloud\/wp-content\/uploads\/2022\/02\/2022-02-21_12h35_28-1-1024x505.png\" alt=\"\" class=\"wp-image-18329\" srcset=\"https:\/\/itport.cloud\/wp-content\/uploads\/2022\/02\/2022-02-21_12h35_28-1-1024x505.png 1024w, https:\/\/itport.cloud\/wp-content\/uploads\/2022\/02\/2022-02-21_12h35_28-1-300x148.png 300w, https:\/\/itport.cloud\/wp-content\/uploads\/2022\/02\/2022-02-21_12h35_28-1-768x379.png 768w, https:\/\/itport.cloud\/wp-content\/uploads\/2022\/02\/2022-02-21_12h35_28-1-1536x758.png 1536w, https:\/\/itport.cloud\/wp-content\/uploads\/2022\/02\/2022-02-21_12h35_28-1-450x222.png 450w, https:\/\/itport.cloud\/wp-content\/uploads\/2022\/02\/2022-02-21_12h35_28-1-900x444.png 900w, https:\/\/itport.cloud\/wp-content\/uploads\/2022\/02\/2022-02-21_12h35_28-1.png 1920w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>\u3053\u308c\u3067\u52d5\u4f5c\u78ba\u8a8d\u306f\u7d42\u308f\u308a\u3067\u3059\u304c\u3001\u3053\u308c\u3060\u3068\u5b9f\u969b\u306bDB\u3092\u4f7f\u3063\u3066\u3044\u308b\u306e\u304b\u304c\u5206\u304b\u3089\u306a\u3044\u306e\u3067\u3001Docker\u30b3\u30f3\u30c6\u30ca\u306b\u5165\u3063\u3066\u78ba\u8a8d\u3057\u3066\u307f\u307e\u3059\u3002<br>Docker\u3092\u8d77\u52d5\u3057\u3066\u3001\u5bfe\u8c61\u306e\u30b3\u30f3\u30c6\u30ca\u306eCLI\u3092\u8d77\u52d5\u3057\u307e\u3059\u3002<br>\u4eca\u56de\u306f\u300cdockercompose\u30fb\u30fb\u30fb\u300d\u3068\u3044\u3046\u540d\u524d\u304c\u3064\u3044\u3066\u3044\u308b\u3082\u306e\u3092\u30af\u30ea\u30c3\u30af\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"560\" src=\"https:\/\/itport.cloud\/wp-content\/uploads\/2022\/02\/2022-02-21_12h38_24-1024x560.png\" alt=\"\" class=\"wp-image-18330\" srcset=\"https:\/\/itport.cloud\/wp-content\/uploads\/2022\/02\/2022-02-21_12h38_24-1024x560.png 1024w, https:\/\/itport.cloud\/wp-content\/uploads\/2022\/02\/2022-02-21_12h38_24-300x164.png 300w, https:\/\/itport.cloud\/wp-content\/uploads\/2022\/02\/2022-02-21_12h38_24-768x420.png 768w, https:\/\/itport.cloud\/wp-content\/uploads\/2022\/02\/2022-02-21_12h38_24-1536x840.png 1536w, https:\/\/itport.cloud\/wp-content\/uploads\/2022\/02\/2022-02-21_12h38_24-450x246.png 450w, https:\/\/itport.cloud\/wp-content\/uploads\/2022\/02\/2022-02-21_12h38_24-900x492.png 900w, https:\/\/itport.cloud\/wp-content\/uploads\/2022\/02\/2022-02-21_12h38_24.png 1920w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>\u305d\u3046\u3059\u308b\u3068\u30b3\u30f3\u30c6\u30ca\u306e\u4e00\u89a7\u304c\u8868\u793a\u3055\u308c\u308b\u306e\u3067\u3001\u6b21\u3082\u300cdockercompose\u30fb\u30fb\u30fb\u300d\u3068\u3044\u3046\u540d\u524d\u306e\u30b3\u30f3\u30c6\u30ca\u3092\u9078\u629e\u3057\u3066\u3001\u300cCLI\u300d\u30dc\u30bf\u30f3\u3092\u30af\u30ea\u30c3\u30af\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"560\" src=\"https:\/\/itport.cloud\/wp-content\/uploads\/2022\/02\/2022-02-21_12h39_38-1024x560.png\" alt=\"\" class=\"wp-image-18332\" srcset=\"https:\/\/itport.cloud\/wp-content\/uploads\/2022\/02\/2022-02-21_12h39_38-1024x560.png 1024w, https:\/\/itport.cloud\/wp-content\/uploads\/2022\/02\/2022-02-21_12h39_38-300x164.png 300w, https:\/\/itport.cloud\/wp-content\/uploads\/2022\/02\/2022-02-21_12h39_38-768x420.png 768w, https:\/\/itport.cloud\/wp-content\/uploads\/2022\/02\/2022-02-21_12h39_38-1536x840.png 1536w, https:\/\/itport.cloud\/wp-content\/uploads\/2022\/02\/2022-02-21_12h39_38-450x246.png 450w, https:\/\/itport.cloud\/wp-content\/uploads\/2022\/02\/2022-02-21_12h39_38-900x492.png 900w, https:\/\/itport.cloud\/wp-content\/uploads\/2022\/02\/2022-02-21_12h39_38.png 1920w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"560\" src=\"https:\/\/itport.cloud\/wp-content\/uploads\/2022\/02\/2022-02-21_12h39_27-1024x560.png\" alt=\"\" class=\"wp-image-18331\" srcset=\"https:\/\/itport.cloud\/wp-content\/uploads\/2022\/02\/2022-02-21_12h39_27-1024x560.png 1024w, https:\/\/itport.cloud\/wp-content\/uploads\/2022\/02\/2022-02-21_12h39_27-300x164.png 300w, https:\/\/itport.cloud\/wp-content\/uploads\/2022\/02\/2022-02-21_12h39_27-768x420.png 768w, https:\/\/itport.cloud\/wp-content\/uploads\/2022\/02\/2022-02-21_12h39_27-1536x840.png 1536w, https:\/\/itport.cloud\/wp-content\/uploads\/2022\/02\/2022-02-21_12h39_27-450x246.png 450w, https:\/\/itport.cloud\/wp-content\/uploads\/2022\/02\/2022-02-21_12h39_27-900x492.png 900w, https:\/\/itport.cloud\/wp-content\/uploads\/2022\/02\/2022-02-21_12h39_27.png 1920w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>\u30b3\u30de\u30f3\u30c9\u30d7\u30ed\u30f3\u30d7\u30c8\u306b\u4f3c\u305f\u753b\u9762\u304c\u958b\u304f\u306e\u3067\u300cpsql -U {db\u30e6\u30fc\u30b6\u30fc\u540d} -d {\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u540d}\u300d\u3092\u5165\u529b\u3057\u3066DB\u306b\u63a5\u7d9a\u3057\u307e\u3059\u3002<br>\u4eca\u56de\u306fdb\u30e6\u30fc\u30b6\u30fc\u540d\u3001\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u540d\u3068\u3082\u306b\u300cpostgres\u300d\u306b\u3057\u3066\u3044\u308b\u306e\u3067\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"979\" height=\"512\" src=\"https:\/\/itport.cloud\/wp-content\/uploads\/2022\/02\/2022-02-21_12h42_09.png\" alt=\"\" class=\"wp-image-18333\" srcset=\"https:\/\/itport.cloud\/wp-content\/uploads\/2022\/02\/2022-02-21_12h42_09.png 979w, https:\/\/itport.cloud\/wp-content\/uploads\/2022\/02\/2022-02-21_12h42_09-300x157.png 300w, https:\/\/itport.cloud\/wp-content\/uploads\/2022\/02\/2022-02-21_12h42_09-768x402.png 768w, https:\/\/itport.cloud\/wp-content\/uploads\/2022\/02\/2022-02-21_12h42_09-450x235.png 450w, https:\/\/itport.cloud\/wp-content\/uploads\/2022\/02\/2022-02-21_12h42_09-900x471.png 900w\" sizes=\"auto, (max-width: 979px) 100vw, 979px\" \/><\/figure>\n\n\n\n<p>\u3053\u308c\u3067DB\u306b\u63a5\u7d9a\u304c\u51fa\u6765\u305f\u306e\u3067\u3001\u5bfe\u8c61\u306e\u30c6\u30fc\u30d6\u30eb\u306b\u30c7\u30fc\u30bf\u304c\u5165\u3063\u3066\u3044\u308b\u304b\u78ba\u8a8d\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"979\" height=\"512\" src=\"https:\/\/itport.cloud\/wp-content\/uploads\/2022\/02\/2022-02-21_12h44_14.png\" alt=\"\" class=\"wp-image-18334\" srcset=\"https:\/\/itport.cloud\/wp-content\/uploads\/2022\/02\/2022-02-21_12h44_14.png 979w, https:\/\/itport.cloud\/wp-content\/uploads\/2022\/02\/2022-02-21_12h44_14-300x157.png 300w, https:\/\/itport.cloud\/wp-content\/uploads\/2022\/02\/2022-02-21_12h44_14-768x402.png 768w, https:\/\/itport.cloud\/wp-content\/uploads\/2022\/02\/2022-02-21_12h44_14-450x235.png 450w, https:\/\/itport.cloud\/wp-content\/uploads\/2022\/02\/2022-02-21_12h44_14-900x471.png 900w\" sizes=\"auto, (max-width: 979px) 100vw, 979px\" \/><\/figure>\n\n\n\n<p>\u3053\u308c\u3067\u7121\u4e8b\u306bDocker \u30b3\u30f3\u30c6\u30ca\u306b\u3042\u308bDB\u306b\u3082\u30c7\u30fc\u30bf\u304c\u767b\u9332\u3055\u308c\u3066\u3044\u308b\u3053\u3068\u304c\u78ba\u8a8d\u3067\u304d\u305f\u306e\u3067\u4eca\u56de\u306f\u3053\u3053\u307e\u3067\u3068\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"topic6\">\u7d42\u308f\u308a<\/h2>\n\n\n\n<p>\u4eca\u56de\u306fVisual Studio\u306eDocker Compose\u3092\u4f7f\u3063\u3066\u30c7\u30d0\u30c3\u30b0\u7528\u306eDB\u3092Docker\u30b3\u30f3\u30c6\u30ca\u306b\u7528\u610f\u3059\u308b\u65b9\u6cd5\u3067\u3057\u305f\u3002<br>\u3053\u308c\u3092\u4f7f\u3048\u3070\u4eca\u5f8c\u306fDB\u3092\u6bce\u56de\u7acb\u3066\u305a\u3068\u3082\u3001\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306b\u3042\u3063\u305fDB\u306e\u30b3\u30f3\u30c6\u30ca\u3092\u7c21\u5358\u306b\u4f5c\u308c\u308b\u306e\u3067\u697d\u306b\u306a\u308b\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002<\/p>\n\n\n","protected":false},"excerpt":{"rendered":"\u76ee\u6b21 \u306f\u3058\u3081\u306b\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306e\u4f5c\u6210Entity Framework Core\u3092\u4f7f\u3063\u3066\u4e8b\u524d\u6e96\u5099 Docker Compose\u306e\u8a2d\u5b9a \u52d5\u4f5c\u78ba\u8a8d\u7d42\u308f\u308a \u306f\u3058\u3081\u306b \u6700\u8fd1\u3001Visual Studio\u3067 .Net 5 \u3092\u4f7f\u3063\u305f\u958b\u767a\u306b\u643a\u308f\u308b\u3053\u3068\u304c\u3042\u308a\u3001Docker\u3092\u4f7f\u3063\u3066\u30c7\u30d0\u30c3\u30b0\u3092\u3057\u3066\u304a\u308a\u307e\u3057\u305f\u3002\u305d\u306e\u6642\u306bDB\u304c\u5fc5\u8981\u3067\u3001\u51fa\u6765\u308c\u3070DB\u3082 Docker \u3092\u4f7f\u3044\u305f\u3044\u3068\u601d\u3044\u8abf\u3079\u3066\u3044\u305f\u3068\u3053\u308d\u3001Visual Studio\u306e\u6a5f\u80fd\u3067\u30c7\u30d0\u30c3\u30b0\u7528\u306b Docker \u3067DB\u3082\u4f7f\u3048\u308b\u3053\u3068\u304c\u5206\u304b\u3063\u305f\u306e\u3067\u305d\u3061\u3089\u3092\u8a18\u4e8b\u306b\u3057\u3088\u3046\u3068\u601d\u3044\u307e\u3059\u3002\u74b0\u5883\u306f\u4ee5\u4e0b\u3067\u884c\u3044\u307e\u3059\u3002\uff08\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u624b\u9806\u306f\u7701\u304d\u307e\u3059\uff09\u74b0\u5883Windows10Visual Studio 2019 EnterpriseDocker &hellip;","protected":false},"author":1,"featured_media":18338,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[136],"tags":[40],"class_list":{"0":"post-18311","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-docker","8":"tag-article"},"_links":{"self":[{"href":"https:\/\/itport.cloud\/index.php?rest_route=\/wp\/v2\/posts\/18311","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/itport.cloud\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/itport.cloud\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/itport.cloud\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/itport.cloud\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=18311"}],"version-history":[{"count":11,"href":"https:\/\/itport.cloud\/index.php?rest_route=\/wp\/v2\/posts\/18311\/revisions"}],"predecessor-version":[{"id":18342,"href":"https:\/\/itport.cloud\/index.php?rest_route=\/wp\/v2\/posts\/18311\/revisions\/18342"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/itport.cloud\/index.php?rest_route=\/wp\/v2\/media\/18338"}],"wp:attachment":[{"href":"https:\/\/itport.cloud\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=18311"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/itport.cloud\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=18311"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/itport.cloud\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=18311"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}