Created
August 31, 2020 20:15
-
-
Save sondreb/a501fcba611c5d2eff1a1aa3762bae6d to your computer and use it in GitHub Desktop.
Most basic Azure DevOps pipeline and Dockerfile for ASP.NET Core with SPA (Angular/React)
This file contains 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
azure-pipeline.yml: | |
name: Build and Push ($(Date:yyyyMMdd)$(Rev:.r)) | |
trigger: | |
- master | |
pool: | |
vmImage: 'ubuntu-latest' | |
steps: | |
- script: dotnet publish --configuration 'Release' -o ./publish | |
displayName: 'dotnet publish' | |
- task: Docker@2 | |
displayName: Docker Build and Push | |
inputs: | |
command: buildAndPush | |
containerRegistry: azureacr | |
repository: company/company-web | |
Dockerfile: '**/Dockerfile' | |
buildContext: '.' | |
addPipelineData: true | |
tags: | | |
$(Build.BuildId) | |
latest | |
Dockerfile: | |
FROM mcr.microsoft.com/dotnet/core/aspnet:3.1-buster-slim AS runtime | |
EXPOSE 80 | |
WORKDIR /app | |
COPY ./publish ./ | |
ENTRYPOINT ["dotnet", "Company.Web.dll"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
To deploy the end results to Azure Web App for Containers, you simply add the following at the end of the pipeline: