Skip to content

Instantly share code, notes, and snippets.

@autukill
Created December 4, 2019 05:25
Show Gist options
  • Save autukill/c4ea3c95d2fdf42673a36dc990ec45dc to your computer and use it in GitHub Desktop.
Save autukill/c4ea3c95d2fdf42673a36dc990ec45dc to your computer and use it in GitHub Desktop.
asp.net core 3.0 on docker
version: "2"
services:
my-app:
image: thinktank/my-app:1.0
build:
context: .
dockerfile: Dockerfile
ports:
- "5000:5000"
# Or
#version: "2"
#services:
# my-app:
# image: thinktank/my-app:1.0
# ports:
# - "5000:5000"
#
# dotnet new web
# touch Dockerfile
#
FROM mcr.microsoft.com/dotnet/core/sdk:3.0-buster AS build
WORKDIR /src
COPY . .
RUN dotnet restore
RUN dotnet publish -c Release -o /out
FROM mcr.microsoft.com/dotnet/core/aspnet:3.0
WORKDIR /app
COPY --from=build /out .
ENV ASPNETCORE_URLS http://*:5000
ENTRYPOINT ["dotnet", "my-dotnet.dll"]
# docker build -t thinktank/my-app:1.0 .
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment