From 5503a82241c50e26d0d2602b8de0c1ec7ebb7790 Mon Sep 17 00:00:00 2001 From: Tudor Stanciu Date: Sun, 7 Jun 2020 14:32:46 +0300 Subject: [PATCH] dockerfile update and notes --- Chatbot.Api/Dockerfile | 3 +++ Chatbot.Api/appsettings.json | 2 +- Notes.txt | 38 +++++++++++++++++++++++++++++++++++- 3 files changed, 41 insertions(+), 2 deletions(-) diff --git a/Chatbot.Api/Dockerfile b/Chatbot.Api/Dockerfile index 853d212..7ef12bb 100644 --- a/Chatbot.Api/Dockerfile +++ b/Chatbot.Api/Dockerfile @@ -27,4 +27,7 @@ COPY --from=publish /app/publish . ENV urls="http://*:80" ENV ConnectionStrings__DatabaseConnection="***REMOVED***" +#Workaround to lower the TLS level in container for old sql server version +RUN sed -i 's/TLSv1.2/TLSv1.0/g' /etc/ssl/openssl.cnf + ENTRYPOINT ["dotnet", "Chatbot.Api.dll", "--docker"] \ No newline at end of file diff --git a/Chatbot.Api/appsettings.json b/Chatbot.Api/appsettings.json index 2ea9fa6..3ee5a91 100644 --- a/Chatbot.Api/appsettings.json +++ b/Chatbot.Api/appsettings.json @@ -5,7 +5,7 @@ }, "Logging": { "LogLevel": { - "Default": "Information", + "Default": "Debug", "Microsoft": "Warning", "Microsoft.Hosting.Lifetime": "Information" } diff --git a/Notes.txt b/Notes.txt index 550aca0..5089026 100644 --- a/Notes.txt +++ b/Notes.txt @@ -1 +1,37 @@ -Basic ***REMOVED*** \ No newline at end of file +Basic ***REMOVED*** + + +############################################################################################## +Docker commands: +***************** + +Create image: +--from solution folder: +docker image build -t "chatbot-api:1.0.0" -f "Chatbot.Api\Dockerfile" . + +Run image: +docker run -p 5053:80 -it chatbot-api:1.0.0 + +Push image to registry: +--tag image +docker tag chatbot-api:1.0.0 cloud.canister.io:5000/tstanciu/chatbot:api-1.0.0 + +--login to registry +docker login --username=tstanciu --password="***REMOVED***" cloud.canister.io:5000 + +--push image +docker push cloud.canister.io:5000/tstanciu/chatbot:api-1.0.0 + +Pull image from registry +--login to registry with readonly rights +docker login --username=deploy+tstanciu --password=***REMOVED*** cloud.canister.io:5000 + +--pull image +docker pull cloud.canister.io:5000/tstanciu/chatbot:api-1.0.0 + +Run container in prod env +docker run --restart=always -p 5006:80 -d cloud.canister.io:5000/tstanciu/chatbot:api-1.0.0 + +Rename container +docker rename chatbot-api +############################################################################################## \ No newline at end of file