diff --git a/.docker/docker-compose.override.yml b/.docker/docker-compose.override.yml index 3093896c..4630d9b4 100644 --- a/.docker/docker-compose.override.yml +++ b/.docker/docker-compose.override.yml @@ -11,6 +11,7 @@ services: - ASPNETCORE_HTTPS_PORT=443 - ASPNETCORE_Kestrel__Certificates__Default__Password=MyCertificatePassword - ASPNETCORE_Kestrel__Certificates__Default__Path=/https/localhost.pfx + - PersistenceModule__DefaultConnection=Server=sql1;User Id=sa;Password=;Database=Accounts; volumes: - ~/.aspnet/https:/https:ro identity-server: diff --git a/.docker/startup.sh b/.docker/startup.sh index 32dd400d..be263d21 100755 --- a/.docker/startup.sh +++ b/.docker/startup.sh @@ -18,11 +18,11 @@ echo "4. Building Docker images in silent mode. This may take few minutes..." echo -e "\n\n\tYou many need to manually startup Docker before running this script.\n\n" docker-compose build --quiet echo "5. Starting up SQL Server in Docker..." -#docker-compose up -d sql1 +docker-compose up -d sql1 echo "6. Installing Entity Framework Tool to migrate databases." -#dotnet tool update --global dotnet-ef --version 3.1.7 +dotnet tool update --global dotnet-ef --version 3.1.7 echo "7. Generating accounts schema in DB..." -#dotnet ef database update --project ../accounts-api/src/Infrastructure --startup-project ../accounts-api/src/WebApi +dotnet ef database update --project ../accounts-api/src/Infrastructure --startup-project ../accounts-api/src/WebApi echo "8. Starting up Identity Server and Accounts applications." docker-compose up -d echo -e "9. Browse to $(tput setaf 3)https://wallet.local/$(tput sgr0)\n\nUse the following credentials to login into Identity Server:\n\n\tUsername:\t$(tput setaf 3)alice$(tput sgr0)\n\tPassword:\t$(tput setaf 3)alice$(tput sgr0)" diff --git a/accounts-api/src/WebApi/Dockerfile b/accounts-api/src/WebApi/Dockerfile index 3208ad8d..13121cc5 100644 --- a/accounts-api/src/WebApi/Dockerfile +++ b/accounts-api/src/WebApi/Dockerfile @@ -22,6 +22,6 @@ RUN dotnet publish "WebApi.csproj" -c Release -o /app/publish FROM base AS final WORKDIR /app COPY --from=publish /app/publish . -#RUN cp /https/cert.crt /usr/local/share/ca-certificates/cert.crt -#RUN chmod 644 /usr/local/share/ca-certificates/cert.crt && update-ca-certificates -ENTRYPOINT ["dotnet", "WebApi.dll"] +COPY /src/WebApi/entrypoint.sh /usr/local/bin/entrypoint.sh +RUN chmod +x /usr/local/bin/entrypoint.sh +CMD ["entrypoint.sh"] diff --git a/accounts-api/src/WebApi/entrypoint.sh b/accounts-api/src/WebApi/entrypoint.sh new file mode 100644 index 00000000..76d15826 --- /dev/null +++ b/accounts-api/src/WebApi/entrypoint.sh @@ -0,0 +1,4 @@ +#!/bin/bash +cp /https/localhost.crt /usr/local/share/ca-certificates/localhost.crt +update-ca-certificates +dotnet WebApi.dll diff --git a/nginx/nginx.conf b/nginx/nginx.conf index 308d313e..e810837f 100644 --- a/nginx/nginx.conf +++ b/nginx/nginx.conf @@ -17,7 +17,6 @@ http { server { listen 443 ssl; - # server_name wallet.local; ssl_certificate /etc/ssl/certs/localhost.crt; ssl_certificate_key /etc/ssl/private/localhost.key; @@ -34,13 +33,13 @@ http { location /identity-server { rewrite /identity-server/?(.*) /$1 break; - proxy_pass http://identity-server; + proxy_pass https://identity-server; } - # location /accounts-api { - # rewrite /accounts-api/?(.*) /$1 break; - # proxy_pass http://accounts-api; - # } + location /accounts-api { + rewrite /accounts-api/?(.*) /$1 break; + proxy_pass https://accounts-api; + } location / { proxy_pass http://wallet-spa:3000;