DanWahlin / AspNetCorePostgreSQLDockerApp

ASP.NET Core with PostgreSQL Docker App Demo

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

aspnetcore.development.dockerfile fail

Yip-Yip opened this issue · comments

FYI Environment Windows 10 machine
aspnetcore proj fails on build cant find csproj

Fix

(1)
aspnetcore.development.dockerfile
/*
FROM microsoft/dotnet:2.1-sdk

LABEL author="Dan Wahlin"

ENV DOTNET_USE_POLLING_FILE_WATCHER=1
ENV ASPNETCORE_URLS=http://*:5000

EXPOSE 5000

WORKDIR /var/www/aspnetcoreapp

COPY AspNetCorePostgreSQLDockerApp.csproj .

CMD ["/bin/bash", "-c", "dotnet restore AspNetCorePostgreSQLDockerApp.csproj && dotnet run"]
*/

(2)
docker build -f aspnetcore.development.dockerfile -t [insert docker id]/dotnet:1.0.0 .

(3)
docker run -d -p 5000:5000 -v "%cd%":/var/www/aspnetcoreapp --link my-postgres:postgres [insert docker id]/dotnet:1.0.0

For the development dockerfile you'd need to setup a volume that points to the source code. That's why you're getting an error. COPY would only be used for the production version where you want to copy the actual code (or the final compiled dll) into the image.

In the readme you'll see instructions for running things using Docker Compose and you'll find a volume setup in the docker-compose.yml file. Hope that helps.

I understand that there is a mixture of old/new sample files as noted in your course.

Just finishing "Managing Containers with Docker Compose"

We are a small startup, would it be correct in assuming that docker-compose should do us well and that Kubernettes is overkill until we need to scale in a Large way.

And finally docker cloud is EOL what would be PaaS choice replacement ?

Thanks

Justin

All of the code samples have been updated actually for the course Docker for Web Developers course. The final module on Docker Cloud will be replaced at some point due to the end of life. I may replace that module with an overview of Kubernetes and AKS (Azure's Kubernetes offering) but haven't decided on that yet.

As far as your question, you can certainly get by with docker compose if you just need a single node/VM for now. It's not a perfect solution, but if you want to go that route it's definitely better than trying to orchestrate containers manually.