Created Woodpecker CI/CD deployment
- Created Dockerfile for packing up API and Web projects as Docker image
This commit is contained in:
38
API/YABA.API/Dockerfile
Normal file
38
API/YABA.API/Dockerfile
Normal file
@ -0,0 +1,38 @@
|
||||
#See https://aka.ms/customizecontainer to learn how to customize your debug container and how Visual Studio uses this Dockerfile to build your images for faster debugging.
|
||||
|
||||
FROM mcr.microsoft.com/dotnet/aspnet:6.0-alpine AS base
|
||||
WORKDIR /app
|
||||
EXPOSE 80
|
||||
EXPOSE 443
|
||||
|
||||
# Set environment variables
|
||||
ENV ASPNETCORE_Environment=Development
|
||||
ENV ASPNETCORE_Authentication__Auth0__ClientId=
|
||||
ENV ASPNETCORE_Authentication__Auth0__ClientSecret=
|
||||
ENV ASPNETCORE_Authentication__Auth0__Domain=
|
||||
ENV ASPNETCORE_Authentication__Auth0__Identifier=
|
||||
ENV ASPNETCORE_ConnectionStrings__YABAReadOnlyDbConnectionString=
|
||||
ENV ASPNETCORE_ConnectionStrings__YABAReadWriteDbConnectionString=
|
||||
ENV WebClient__Url=
|
||||
ENV Serilog__WriteTo__1__Args__Uri=
|
||||
ENV Serilog__WriteTo__1__Args__Labels__1__Value=
|
||||
|
||||
FROM mcr.microsoft.com/dotnet/sdk:6.0-alpine AS build
|
||||
WORKDIR /src
|
||||
COPY ["YABA.API/YABA.API.csproj", "YABA.API/"]
|
||||
COPY ["YABA.Common/YABA.Common.csproj", "YABA.Common/"]
|
||||
COPY ["YABA.Data/YABA.Data.csproj", "YABA.Data/"]
|
||||
COPY ["YABA.Models/YABA.Models.csproj", "YABA.Models/"]
|
||||
COPY ["YABA.Service/YABA.Service.csproj", "YABA.Service/"]
|
||||
RUN dotnet restore "YABA.API/YABA.API.csproj"
|
||||
COPY . .
|
||||
WORKDIR "/src/YABA.API"
|
||||
RUN dotnet build "YABA.API.csproj" -c Release -o /app/build
|
||||
|
||||
FROM build AS publish
|
||||
RUN dotnet publish "YABA.API.csproj" -c Release -o /app/publish /p:UseAppHost=false
|
||||
|
||||
FROM base AS final
|
||||
WORKDIR /app
|
||||
COPY --from=publish /app/publish .
|
||||
ENTRYPOINT ["dotnet", "YABA.API.dll"]
|
||||
Reference in New Issue
Block a user