{"action":"opened","issue":{"url":"https://api.github.com/repos/skoruba/IdentityServer4.Admin/issues/121","repository_url":"https://api.github.com/repos/skoruba/IdentityServer4.Admin","labels_url":"https://api.github.com/repos/skoruba/IdentityServer4.Admin/issues/121/labels{/name}","comments_url":"https://api.github.com/repos/skoruba/IdentityServer4.Admin/issues/121/comments","events_url":"https://api.github.com/repos/skoruba/IdentityServer4.Admin/issues/121/events","html_url":"https://github.com/skoruba/IdentityServer4.Admin/issues/121","id":383799900,"node_id":"MDU6SXNzdWUzODM3OTk5MDA=","number":121,"title":"Docker support","user":{"login":"NTurakulov","id":7259932,"node_id":"MDQ6VXNlcjcyNTk5MzI=","avatar_url":"https://avatars0.githubusercontent.com/u/7259932?v=4","gravatar_id":"","url":"https://api.github.com/users/NTurakulov","html_url":"https://github.com/NTurakulov","followers_url":"https://api.github.com/users/NTurakulov/followers","following_url":"https://api.github.com/users/NTurakulov/following{/other_user}","gists_url":"https://api.github.com/users/NTurakulov/gists{/gist_id}","starred_url":"https://api.github.com/users/NTurakulov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NTurakulov/subscriptions","organizations_url":"https://api.github.com/users/NTurakulov/orgs","repos_url":"https://api.github.com/users/NTurakulov/repos","events_url":"https://api.github.com/users/NTurakulov/events{/privacy}","received_events_url":"https://api.github.com/users/NTurakulov/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-11-23T12:01:24Z","updated_at":"2018-11-23T12:01:24Z","closed_at":null,"author_association":"NONE","body":"Hey guys!\r\nI tried to pack the project into docker to make it easy to deploy and faced some problems, maybe some one could help here. Changes published to [docker branch](https://github.com/NTurakulov/IdentityServer4.Admin/tree/docker)\r\n\r\n**Requirement**\r\nMake it easy to deploy Identity Server Admin to use it in different apps as a part of micro service architecture. I saw somewhere in the feed that @skoruba planned to pack the project into NuGet but I think docker another way to make it portable\r\n\r\n**Solution**\r\nPack the project (Admin and STS) into docker images and run them at any time with required port inside your cluster\r\n\r\n**Implementation**\r\nI added two Dockerfiles in target project folders, docker-compose.yml in root plus several powershell scripts in the folder with same name. It works but made dummy. To start run containers - run 'run-docker.ps1' script or execute commands from it one by one (for non-Windows platforms).\r\n\r\nSQL server is also packed into an image and run as a part of compose with persistent external volume (skoruba-identityserver-sql). All three containers (SQL, STS, Admin) work within same docker network (skoruba-identityserver-network) and can interact with each other\r\n\r\n**Note** \r\n- Admin project port 80 is mapped to host's port **5001** instead of 9000\r\n- MS SQL container's port 1433 is mapped to host's 1433**3**! This made for compatibility with MS SQL instance on the host\r\n\r\n**Problems**\r\n\r\n- Dependency projects are not packed as NuGet and cannot be restored with 'dotnet restore'. Because of that instead of using single multi step Dockerfile I build it on host then just copy to aspnetcore-runtime image. This can be solved with modified Dockerfile which copies 'bin' folder with dependencies but prebuild on host is required anyway. Also projects use 'npm install' which is not preinstalled into default aspnetcore-sdk build image.\r\n    - As dotnet CLI calls required before 'docker build' they're packed into build-docker-*.ps1 scripts\r\n- I've added DockerRelease config file with overriden parameters but they don't apply so duplicated in docker-compose.yml and passed with 'environment'\r\n- While STS and Admin containers can use short docker-compose.yml service names when reference to sql container successfully I can't access to sts/.well-known/openid-configuration from within Admin project\r\n- Don't know how to apply EF migrations from within container. Before building docker image DbContext reference to host DB, after running a container not sure how to do that. Maybe something like 'EXEC dotnet ef database update'? Need to try this way\r\n- Both projects are configured to run in 'Development' environment because certificate for HTTPS is not set up"}}
{"actor":{"display_login":"NTurakulov"}}