Created
December 4, 2019 05:25
-
-
Save autukill/c4ea3c95d2fdf42673a36dc990ec45dc to your computer and use it in GitHub Desktop.
asp.net core 3.0 on docker
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# 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