From 078fa26bd48f9480876406e1da9ce09e64caf734 Mon Sep 17 00:00:00 2001 From: Theo DUPIN Date: Tue, 21 Mar 2023 11:29:56 +0100 Subject: [PATCH] Test d'ajout dans la table Score qui prend un nombre de points total, l'id d'une Game et l'id d'un Player --- .../20230320170448_AllMigrations.Designer.cs | 175 ------------------ .../20230320170448_AllMigrations.cs | 151 --------------- .../Migrations/SQLiteContextModelSnapshot.cs | 172 ----------------- Sources/Tests/DbConsole/Program.cs | 54 +++--- .../Tests/DbConsole/projet.ToutesTables.db | Bin 49152 -> 0 bytes .../DbConsole/projet.ToutesTables.db-wal | 0 Sources/Trek12_API.sln | 12 +- Sources/Trek12_Lib/GameEntity.cs | 3 +- Sources/Trek12_Lib/PlayerEntity.cs | 2 +- Sources/Trek12_Lib/ScoreEntity.cs | 2 +- Sources/Trek12_Lib/TrekContext.cs | 20 ++ docker-compose/.dockerignore | 25 +++ docker-compose/docker-compose.dcproj | 18 ++ docker-compose/docker-compose.override.yml | 13 ++ docker-compose/docker-compose.yml | 8 + 15 files changed, 123 insertions(+), 532 deletions(-) delete mode 100644 Sources/Tests/DbConsole/Migrations/20230320170448_AllMigrations.Designer.cs delete mode 100644 Sources/Tests/DbConsole/Migrations/20230320170448_AllMigrations.cs delete mode 100644 Sources/Tests/DbConsole/Migrations/SQLiteContextModelSnapshot.cs delete mode 100644 Sources/Tests/DbConsole/projet.ToutesTables.db delete mode 100644 Sources/Tests/DbConsole/projet.ToutesTables.db-wal create mode 100644 docker-compose/.dockerignore create mode 100644 docker-compose/docker-compose.dcproj create mode 100644 docker-compose/docker-compose.override.yml create mode 100644 docker-compose/docker-compose.yml diff --git a/Sources/Tests/DbConsole/Migrations/20230320170448_AllMigrations.Designer.cs b/Sources/Tests/DbConsole/Migrations/20230320170448_AllMigrations.Designer.cs deleted file mode 100644 index 90b7534..0000000 --- a/Sources/Tests/DbConsole/Migrations/20230320170448_AllMigrations.Designer.cs +++ /dev/null @@ -1,175 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace DbConsole.Migrations -{ - [DbContext(typeof(SQLiteContext))] - [Migration("20230320170448_AllMigrations")] - partial class AllMigrations - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder.HasAnnotation("ProductVersion", "7.0.2"); - - modelBuilder.Entity("EntityFrameWorkLib.CaseEntity", b => - { - b.Property("CaseId") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("Value") - .HasColumnType("INTEGER"); - - b.HasKey("CaseId"); - - b.ToTable("Case"); - }); - - modelBuilder.Entity("EntityFrameWorkLib.GameEntity", b => - { - b.Property("GameId") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("Date") - .HasColumnType("TEXT"); - - b.Property("Duration") - .HasColumnType("TEXT"); - - b.Property("Name") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("NbPlayers") - .HasColumnType("INTEGER"); - - b.HasKey("GameId"); - - b.ToTable("Game"); - }); - - modelBuilder.Entity("EntityFrameWorkLib.GrilleEntity", b => - { - b.Property("GrilleId") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("MaxChain") - .HasColumnType("INTEGER"); - - b.Property("MaxZone") - .HasColumnType("INTEGER"); - - b.Property("NbChains") - .HasColumnType("INTEGER"); - - b.Property("NbZones") - .HasColumnType("INTEGER"); - - b.HasKey("GrilleId"); - - b.ToTable("Grille"); - }); - - modelBuilder.Entity("EntityFrameWorkLib.PlayerEntity", b => - { - b.Property("PlayerId") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("MaxPoints") - .HasColumnType("INTEGER"); - - b.Property("MaxZone") - .HasColumnType("INTEGER"); - - b.Property("NbPlayed") - .HasColumnType("INTEGER"); - - b.Property("NbPoints") - .HasColumnType("INTEGER"); - - b.Property("NbWin") - .HasColumnType("INTEGER"); - - b.Property("Pseudo") - .IsRequired() - .HasColumnType("TEXT"); - - b.HasKey("PlayerId"); - - b.ToTable("Players"); - }); - - modelBuilder.Entity("EntityFrameWorkLib.ScoreEntity", b => - { - b.Property("ScoreId") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("GameId") - .HasColumnType("INTEGER"); - - b.Property("NbPoints") - .HasColumnType("INTEGER"); - - b.Property("PlayerId") - .HasColumnType("INTEGER"); - - b.HasKey("ScoreId"); - - b.HasIndex("GameId"); - - b.HasIndex("PlayerId"); - - b.ToTable("Score"); - }); - - modelBuilder.Entity("EntityFrameWorkLib.TurnEntity", b => - { - b.Property("TurnId") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("DiceValue1") - .HasColumnType("INTEGER"); - - b.Property("DiceValue2") - .HasColumnType("INTEGER"); - - b.HasKey("TurnId"); - - b.ToTable("Turn"); - }); - - modelBuilder.Entity("EntityFrameWorkLib.ScoreEntity", b => - { - b.HasOne("EntityFrameWorkLib.GameEntity", "Game") - .WithMany() - .HasForeignKey("GameId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("EntityFrameWorkLib.PlayerEntity", "Player") - .WithMany() - .HasForeignKey("PlayerId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Game"); - - b.Navigation("Player"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/Sources/Tests/DbConsole/Migrations/20230320170448_AllMigrations.cs b/Sources/Tests/DbConsole/Migrations/20230320170448_AllMigrations.cs deleted file mode 100644 index 96b4dd1..0000000 --- a/Sources/Tests/DbConsole/Migrations/20230320170448_AllMigrations.cs +++ /dev/null @@ -1,151 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace DbConsole.Migrations -{ - /// - public partial class AllMigrations : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.CreateTable( - name: "Case", - columns: table => new - { - CaseId = table.Column(type: "INTEGER", nullable: false) - .Annotation("Sqlite:Autoincrement", true), - Value = table.Column(type: "INTEGER", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_Case", x => x.CaseId); - }); - - migrationBuilder.CreateTable( - name: "Game", - columns: table => new - { - GameId = table.Column(type: "INTEGER", nullable: false) - .Annotation("Sqlite:Autoincrement", true), - Duration = table.Column(type: "TEXT", nullable: false), - Date = table.Column(type: "TEXT", nullable: false), - NbPlayers = table.Column(type: "INTEGER", nullable: false), - Name = table.Column(type: "TEXT", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_Game", x => x.GameId); - }); - - migrationBuilder.CreateTable( - name: "Grille", - columns: table => new - { - GrilleId = table.Column(type: "INTEGER", nullable: false) - .Annotation("Sqlite:Autoincrement", true), - NbChains = table.Column(type: "INTEGER", nullable: false), - NbZones = table.Column(type: "INTEGER", nullable: false), - MaxChain = table.Column(type: "INTEGER", nullable: false), - MaxZone = table.Column(type: "INTEGER", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_Grille", x => x.GrilleId); - }); - - migrationBuilder.CreateTable( - name: "Players", - columns: table => new - { - PlayerId = table.Column(type: "INTEGER", nullable: false) - .Annotation("Sqlite:Autoincrement", true), - Pseudo = table.Column(type: "TEXT", nullable: false), - NbWin = table.Column(type: "INTEGER", nullable: false), - NbPlayed = table.Column(type: "INTEGER", nullable: false), - MaxZone = table.Column(type: "INTEGER", nullable: false), - MaxPoints = table.Column(type: "INTEGER", nullable: false), - NbPoints = table.Column(type: "INTEGER", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_Players", x => x.PlayerId); - }); - - migrationBuilder.CreateTable( - name: "Turn", - columns: table => new - { - TurnId = table.Column(type: "INTEGER", nullable: false) - .Annotation("Sqlite:Autoincrement", true), - DiceValue1 = table.Column(type: "INTEGER", nullable: false), - DiceValue2 = table.Column(type: "INTEGER", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_Turn", x => x.TurnId); - }); - - migrationBuilder.CreateTable( - name: "Score", - columns: table => new - { - ScoreId = table.Column(type: "INTEGER", nullable: false) - .Annotation("Sqlite:Autoincrement", true), - NbPoints = table.Column(type: "INTEGER", nullable: false), - GameId = table.Column(type: "INTEGER", nullable: false), - PlayerId = table.Column(type: "INTEGER", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_Score", x => x.ScoreId); - table.ForeignKey( - name: "FK_Score_Game_GameId", - column: x => x.GameId, - principalTable: "Game", - principalColumn: "GameId", - onDelete: ReferentialAction.Cascade); - table.ForeignKey( - name: "FK_Score_Players_PlayerId", - column: x => x.PlayerId, - principalTable: "Players", - principalColumn: "PlayerId", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateIndex( - name: "IX_Score_GameId", - table: "Score", - column: "GameId"); - - migrationBuilder.CreateIndex( - name: "IX_Score_PlayerId", - table: "Score", - column: "PlayerId"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "Case"); - - migrationBuilder.DropTable( - name: "Grille"); - - migrationBuilder.DropTable( - name: "Score"); - - migrationBuilder.DropTable( - name: "Turn"); - - migrationBuilder.DropTable( - name: "Game"); - - migrationBuilder.DropTable( - name: "Players"); - } - } -} diff --git a/Sources/Tests/DbConsole/Migrations/SQLiteContextModelSnapshot.cs b/Sources/Tests/DbConsole/Migrations/SQLiteContextModelSnapshot.cs deleted file mode 100644 index 2ee2875..0000000 --- a/Sources/Tests/DbConsole/Migrations/SQLiteContextModelSnapshot.cs +++ /dev/null @@ -1,172 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace DbConsole.Migrations -{ - [DbContext(typeof(SQLiteContext))] - partial class SQLiteContextModelSnapshot : ModelSnapshot - { - protected override void BuildModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder.HasAnnotation("ProductVersion", "7.0.2"); - - modelBuilder.Entity("EntityFrameWorkLib.CaseEntity", b => - { - b.Property("CaseId") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("Value") - .HasColumnType("INTEGER"); - - b.HasKey("CaseId"); - - b.ToTable("Case"); - }); - - modelBuilder.Entity("EntityFrameWorkLib.GameEntity", b => - { - b.Property("GameId") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("Date") - .HasColumnType("TEXT"); - - b.Property("Duration") - .HasColumnType("TEXT"); - - b.Property("Name") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("NbPlayers") - .HasColumnType("INTEGER"); - - b.HasKey("GameId"); - - b.ToTable("Game"); - }); - - modelBuilder.Entity("EntityFrameWorkLib.GrilleEntity", b => - { - b.Property("GrilleId") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("MaxChain") - .HasColumnType("INTEGER"); - - b.Property("MaxZone") - .HasColumnType("INTEGER"); - - b.Property("NbChains") - .HasColumnType("INTEGER"); - - b.Property("NbZones") - .HasColumnType("INTEGER"); - - b.HasKey("GrilleId"); - - b.ToTable("Grille"); - }); - - modelBuilder.Entity("EntityFrameWorkLib.PlayerEntity", b => - { - b.Property("PlayerId") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("MaxPoints") - .HasColumnType("INTEGER"); - - b.Property("MaxZone") - .HasColumnType("INTEGER"); - - b.Property("NbPlayed") - .HasColumnType("INTEGER"); - - b.Property("NbPoints") - .HasColumnType("INTEGER"); - - b.Property("NbWin") - .HasColumnType("INTEGER"); - - b.Property("Pseudo") - .IsRequired() - .HasColumnType("TEXT"); - - b.HasKey("PlayerId"); - - b.ToTable("Players"); - }); - - modelBuilder.Entity("EntityFrameWorkLib.ScoreEntity", b => - { - b.Property("ScoreId") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("GameId") - .HasColumnType("INTEGER"); - - b.Property("NbPoints") - .HasColumnType("INTEGER"); - - b.Property("PlayerId") - .HasColumnType("INTEGER"); - - b.HasKey("ScoreId"); - - b.HasIndex("GameId"); - - b.HasIndex("PlayerId"); - - b.ToTable("Score"); - }); - - modelBuilder.Entity("EntityFrameWorkLib.TurnEntity", b => - { - b.Property("TurnId") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("DiceValue1") - .HasColumnType("INTEGER"); - - b.Property("DiceValue2") - .HasColumnType("INTEGER"); - - b.HasKey("TurnId"); - - b.ToTable("Turn"); - }); - - modelBuilder.Entity("EntityFrameWorkLib.ScoreEntity", b => - { - b.HasOne("EntityFrameWorkLib.GameEntity", "Game") - .WithMany() - .HasForeignKey("GameId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("EntityFrameWorkLib.PlayerEntity", "Player") - .WithMany() - .HasForeignKey("PlayerId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Game"); - - b.Navigation("Player"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/Sources/Tests/DbConsole/Program.cs b/Sources/Tests/DbConsole/Program.cs index cd00908..0b4c5db 100644 --- a/Sources/Tests/DbConsole/Program.cs +++ b/Sources/Tests/DbConsole/Program.cs @@ -1,32 +1,21 @@ using EntityFrameWorkLib; using Microsoft.EntityFrameworkCore; +using Model; -PlayerEntity p1 = new PlayerEntity -{ - PlayerId = 0, - Pseudo = "Jax", - NbWin = 0, - NbPlayed = 0, - MaxZone = 0, - MaxPoints = 0, - NbPoints = 0 -}; - -GameEntity g1 = new GameEntity +/*GameEntity g1 = new GameEntity { GameId = 1, -}; +};*/ -PlayerEntity p2 = new PlayerEntity +/*PlayerEntity p1 = new PlayerEntity { - PlayerId = 0, - Pseudo = "Theo", + PlayerId = 1, + Pseudo = "Jax", NbWin = 0, NbPlayed = 0, MaxZone = 0, MaxPoints = 0, - NbPoints = 0 -}; +};*/ /*using (var context = new SQLiteContext()) { @@ -38,14 +27,35 @@ PlayerEntity p2 = new PlayerEntity using (var context = new SQLiteContext()) { - var newScore = new ScoreEntity + var firstGame = new GameEntity { GameId = 1, + Name = "First Game", + }; + var secondGame = new GameEntity + { + GameId = 2, + Name = "Second Game", + }; + var thirdGame = new GameEntity + { + GameId = 3, + Name = "Third Game", + }; + var newPlayer = new PlayerEntity + { PlayerId = 2, - NbPoints = 5 + Pseudo = "Jax" }; - - context.Add(newScore); + var scores = new List + { + new ScoreEntity { GameId = 1, NbPointsTotal = 5 }, + new ScoreEntity { GameId = 2, NbPointsTotal = 10 }, + new ScoreEntity { GameId = 3, NbPointsTotal = 15 } + }; + newPlayer.Scores = scores; + context.AddRange(firstGame, secondGame, thirdGame, newPlayer); + context.AddRange(scores); context.SaveChanges(); } diff --git a/Sources/Tests/DbConsole/projet.ToutesTables.db b/Sources/Tests/DbConsole/projet.ToutesTables.db deleted file mode 100644 index 4c892c43704255dc8f6401ecba2b011363c38e22..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 49152 zcmeI*&u`jh7{GCxq#=RO>{3~653{Ttf?A~{>BNp>;H0Qv7@=KKX+lo$HcJ!~3|f2G zp~^;J<4qTtE7`Jl>5JL{d)h? z%-@^;r2kC)yzyJ|zvM5Xm<0g@5I_KdTPyG;y{0|W)F0e#+j&<$ZXKQV`cA9fvEMuW za@*h9EH=zS)6~mW$voDLiAsiEvvk9+YUtZW)Yiy0Q)}82O&!MjKD6IDVbAFqJqK0B z`V9-Smz9mArfKR=-w*85j^iKKe@cbDH49%<%&P%qQo2}z@s-<#2%~8pnho8mHFfJ% zrJ@&W)={%j5aqg2e;EiEdc9Gu78)n|OY=l8ylU3Umgv4}TFs|nht_Gm=XM9)WRFpe zD2(wVM*Bxn6JrW%Tp!s%II@=P)qj$~9Ml?S`Oxx5xot#5dc!<08>Uq>k95CK&dX@0 zn5~joF~y7)3rEF5$((nzV2s`C4>C{UN6w_OAByWq?ZE@}!u6-K zIqY}kx)GmDStL3O>E+f{2-HeonH!A$}hHC-4}-E)TRo}o9*W0B@zsz-@uoqpvC&RKaWGFzViQ_hvB zgR1@RO|R?B?m|>pbau=>f23!6EvY?xs9px1hkduxaf0V$Tr()V%8g+ACYVvng_hQ7 z@jKh?&Ng7EPBm@77&RGuT=J^viJEc@9d&t$o-jY){2YYt-TMhbqbg$AWz z-yXOtuv8V0|v#CEv$MVMzYb~O#uZpjaC+dkGvv=MR_j@hRIUhRRGiPk` zUQA+a=XO_g|5UWhet5JJeAZ}wpGDhqo9PTyN0pzn@x|h!1~iovV08eafI>z^+5I_I{1Q0*~0R#|00D)U7@bQYdG4F=}^7sGZkN#N@KmY**5I_I{ z1Q0*~0R#|0V2K5||6k(CB{T#OKmY**5I_I{1Q0*~0R%z;?*B;z1Q0*~0R#|0009IL zKmY**mS2GT|K*=!B18ZI1Q0*~0R#|0009ILK!E#yasUAY5I_I{1Q0*~0R#|00Di)KmY**5I_I{1Q0*~0R#}>{+}E`009ILKmY**5I_I{1Q0-A`2|ukME?KZ z@=r7oB7gt_2q1s}0tg_000IcyX#wv4@AUK&JOT(HfB*srAb NbPoints { get; set; } + + public List Scores { get; set; } } } diff --git a/Sources/Trek12_Lib/PlayerEntity.cs b/Sources/Trek12_Lib/PlayerEntity.cs index 516ca91..df457dd 100644 --- a/Sources/Trek12_Lib/PlayerEntity.cs +++ b/Sources/Trek12_Lib/PlayerEntity.cs @@ -14,7 +14,7 @@ namespace EntityFrameWorkLib public int NbPlayed { get; set; } public int MaxZone { get; set; } public int MaxPoints { get; set; } - public int NbPoints { get; set; } + public List Scores { get; set; } } } diff --git a/Sources/Trek12_Lib/ScoreEntity.cs b/Sources/Trek12_Lib/ScoreEntity.cs index 6e81feb..5fdd3be 100644 --- a/Sources/Trek12_Lib/ScoreEntity.cs +++ b/Sources/Trek12_Lib/ScoreEntity.cs @@ -13,7 +13,7 @@ namespace EntityFrameWorkLib [Key] [DatabaseGenerated(DatabaseGeneratedOption.Identity)] public int ScoreId { get; set; } - public int NbPoints { get; set; } + public int NbPointsTotal { get; set; } public int GameId { get; set; } [ForeignKey("GameId")] diff --git a/Sources/Trek12_Lib/TrekContext.cs b/Sources/Trek12_Lib/TrekContext.cs index 87d1a91..d4f79bb 100644 --- a/Sources/Trek12_Lib/TrekContext.cs +++ b/Sources/Trek12_Lib/TrekContext.cs @@ -55,6 +55,26 @@ namespace EntityFrameWorkLib modelBuilder.Entity().Property(n => n.TurnId).ValueGeneratedOnAdd(); modelBuilder.Entity().Property(n => n.ScoreId).ValueGeneratedOnAdd(); + //Configuration des clés primaires et étrangères pour la table Score + modelBuilder.Entity() + .HasKey(s => s.ScoreId); + + modelBuilder.Entity() + .HasKey(g => g.GameId); + + modelBuilder.Entity() + .HasKey(p => p.PlayerId); + + modelBuilder.Entity() + .HasOne(s => s.Game) + .WithMany(g => g.Scores) + .HasForeignKey(s => s.GameId); + + modelBuilder.Entity() + .HasOne(s => s.Player) + .WithMany(p => p.Scores) + .HasForeignKey(s => s.PlayerId); + base.OnModelCreating(modelBuilder); } } diff --git a/docker-compose/.dockerignore b/docker-compose/.dockerignore new file mode 100644 index 0000000..3729ff0 --- /dev/null +++ b/docker-compose/.dockerignore @@ -0,0 +1,25 @@ +**/.classpath +**/.dockerignore +**/.env +**/.git +**/.gitignore +**/.project +**/.settings +**/.toolstarget +**/.vs +**/.vscode +**/*.*proj.user +**/*.dbmdl +**/*.jfm +**/azds.yaml +**/bin +**/charts +**/docker-compose* +**/Dockerfile* +**/node_modules +**/npm-debug.log +**/obj +**/secrets.dev.yaml +**/values.dev.yaml +LICENSE +README.md \ No newline at end of file diff --git a/docker-compose/docker-compose.dcproj b/docker-compose/docker-compose.dcproj new file mode 100644 index 0000000..b4a2717 --- /dev/null +++ b/docker-compose/docker-compose.dcproj @@ -0,0 +1,18 @@ + + + + 2.1 + Linux + {7DF17583-2166-4ABE-82EE-F63CEE2132C2} + True + {Scheme}://localhost:{ServicePort}/swagger + trek12_api + + + + docker-compose.yml + + + + + diff --git a/docker-compose/docker-compose.override.yml b/docker-compose/docker-compose.override.yml new file mode 100644 index 0000000..809d14e --- /dev/null +++ b/docker-compose/docker-compose.override.yml @@ -0,0 +1,13 @@ +version: '3.4' + +services: + trek12_api: + environment: + - ASPNETCORE_ENVIRONMENT=Development + - ASPNETCORE_URLS=https://+:443;http://+:80 + ports: + - "80" + - "443" + volumes: + - ~/.aspnet/https:/root/.aspnet/https:ro + - ~/.microsoft/usersecrets:/root/.microsoft/usersecrets:ro \ No newline at end of file diff --git a/docker-compose/docker-compose.yml b/docker-compose/docker-compose.yml new file mode 100644 index 0000000..2952ce3 --- /dev/null +++ b/docker-compose/docker-compose.yml @@ -0,0 +1,8 @@ +version: '3.4' + +services: + trek12_api: + image: ${DOCKER_REGISTRY-}trek12api + build: + context: . + dockerfile: Trek12_API/Dockerfile