Committing work for creating docker images of Web and API apps

Outstanding work include:
- Adding CI/CD workflow compatible with Woodpecker CI
- Figure out how to load runtime environment variables onto the API docker build process
This commit is contained in:
2024-03-19 20:56:56 -05:00
parent 0ca2a0e38c
commit f1144d2cb9
10 changed files with 17465 additions and 4847 deletions

View File

@ -1,11 +1,20 @@
#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 AS base
FROM mcr.microsoft.com/dotnet/aspnet:6.0-alpine AS base
WORKDIR /app
EXPOSE 80
# EXPOSE 443 # SSL termination expected
EXPOSE 443
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build
# 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=
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/"]

View File

@ -16,6 +16,8 @@ using Serilog;
using Microsoft.AspNetCore.HttpOverrides;
var builder = WebApplication.CreateBuilder(args);
builder.Configuration.AddEnvironmentVariables();
var configuration = builder.Configuration;
// Add services to the container.