diff --git a/Dockerfile.guess-the-song b/Dockerfile.guess-the-song new file mode 100644 index 0000000..a7748d2 --- /dev/null +++ b/Dockerfile.guess-the-song @@ -0,0 +1,25 @@ +# syntax=docker/dockerfile:1 + +FROM mcr.microsoft.com/dotnet/sdk:10.0 AS build +WORKDIR /source + +COPY src/GuessTheSong.Shared/GuessTheSong.Shared.csproj src/GuessTheSong.Shared/ +COPY src/GuessTheSong.Client/GuessTheSong.Client.csproj src/GuessTheSong.Client/ +RUN dotnet restore src/GuessTheSong.Client/GuessTheSong.Client.csproj + +COPY src/GuessTheSong.Shared/ src/GuessTheSong.Shared/ +COPY src/GuessTheSong.Client/ src/GuessTheSong.Client/ +RUN dotnet publish src/GuessTheSong.Client/GuessTheSong.Client.csproj \ + --configuration Release \ + --output /artifacts/client \ + --no-restore + +FROM nginxinc/nginx-unprivileged:alpine AS final + +COPY nginx.guess-the-song.conf /etc/nginx/conf.d/default.conf +COPY --from=build /artifacts/client/wwwroot/ /usr/share/nginx/html/ + +EXPOSE 8080 + +HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \ + CMD wget --quiet --tries=1 --spider http://127.0.0.1:8080/health || exit 1 diff --git a/Dockerfile.guess-the-song.dockerignore b/Dockerfile.guess-the-song.dockerignore new file mode 100644 index 0000000..7a10205 --- /dev/null +++ b/Dockerfile.guess-the-song.dockerignore @@ -0,0 +1,15 @@ +.git +.gitignore +.vs +**/bin +**/obj +**/*.user +**/*.suo +**/appsettings.Development.json + +src/Aquarium.Client +src/Aquarium.Server +src/Aquarium.Shared +src/WebsiteDna.Client +src/WebsiteDna.Server +src/WebsiteDna.Shared diff --git a/nginx.guess-the-song.conf b/nginx.guess-the-song.conf new file mode 100644 index 0000000..cfb98fe --- /dev/null +++ b/nginx.guess-the-song.conf @@ -0,0 +1,18 @@ +server { + listen 8080; + listen [::]:8080; + server_name _; + + root /usr/share/nginx/html; + index index.html; + + location = /health { + access_log off; + default_type text/plain; + return 200 "healthy\n"; + } + + location / { + try_files $uri $uri/ /index.html; + } +} diff --git a/src/GuessTheSong.Client/GuessTheSong.Client.csproj b/src/GuessTheSong.Client/GuessTheSong.Client.csproj index fe8761f..ee4f6de 100644 --- a/src/GuessTheSong.Client/GuessTheSong.Client.csproj +++ b/src/GuessTheSong.Client/GuessTheSong.Client.csproj @@ -9,8 +9,8 @@ - - + +