From 9742e7d137a91a7b9a5080cca99b54b7dd9c46f4 Mon Sep 17 00:00:00 2001 From: violet Date: Fri, 20 Sep 2024 14:29:42 +0900 Subject: [PATCH] pr reviews --- README.md | 4 +++- server/Dockerfile | 5 +++++ server/appsettings.json | 1 + server/docker-entrypoint.sh | 5 ----- 4 files changed, 9 insertions(+), 6 deletions(-) delete mode 100755 server/docker-entrypoint.sh diff --git a/README.md b/README.md index ed865b2..a41c0d2 100644 --- a/README.md +++ b/README.md @@ -26,13 +26,15 @@ The server, client and database can be easily ran in Docker: - Run: `docker compose up -d` - Access the game frontend at http://localhost:5173 +You may have to wait a few seconds after the `docker compose up -d` command before the server is ready, while the database is being set up. + Database files will be stored in `mssql-data` directory. To read the server logs, run `docker compose logs -f backend`. To update the code in the future, run these commands: ``` -docker compose down -rmi +docker compose down --rmi local git pull docker compose build frontend backend docker compose up -d diff --git a/server/Dockerfile b/server/Dockerfile index be1f596..dcb7fbd 100644 --- a/server/Dockerfile +++ b/server/Dockerfile @@ -7,4 +7,9 @@ RUN dotnet build -c Release -o bin RUN dotnet tool install --global dotnet-ef +RUN echo "#!/bin/sh" >> /app/docker-entrypoint.sh \ + && echo "~/.dotnet/tools/dotnet-ef database update" >> /app/docker-entrypoint.sh \ + && echo "dotnet /app/bin/5dDiplomacyWithMultiverseTimeTravel.dll" >> /app/docker-entrypoint.sh \ + && chmod +x /app/docker-entrypoint.sh + CMD ["/app/docker-entrypoint.sh"] diff --git a/server/appsettings.json b/server/appsettings.json index 6e26f48..dedfabe 100644 --- a/server/appsettings.json +++ b/server/appsettings.json @@ -2,6 +2,7 @@ "Logging": { "LogLevel": { "Default": "Information", + "Microsoft.AspNetCore": "Warning" } }, "ConnectionStrings": { diff --git a/server/docker-entrypoint.sh b/server/docker-entrypoint.sh deleted file mode 100755 index d917858..0000000 --- a/server/docker-entrypoint.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -~/.dotnet/tools/dotnet-ef database update - -dotnet /app/bin/5dDiplomacyWithMultiverseTimeTravel.dll