PrayerTracker/src/Dockerfile
Daniel J. Summers dd5f32e320
v8.1 (#47)
- Update to .NET 7
- Update database access to use data source vs. connection
- Allow e-mail server address to be configurable
- Support Docker hosting
2023-07-04 20:03:43 -04:00

26 lines
908 B
Docker

FROM mcr.microsoft.com/dotnet/sdk:7.0-alpine AS build
WORKDIR /pt
COPY ./PrayerTracker.sln ./
COPY ./Directory.Build.props ./
COPY ./PrayerTracker/PrayerTracker.fsproj ./PrayerTracker/
COPY ./PrayerTracker.Data/PrayerTracker.Data.fsproj ./PrayerTracker.Data/
COPY ./PrayerTracker.Tests/PrayerTracker.Tests.fsproj ./PrayerTracker.Tests/
COPY ./PrayerTracker.UI/PrayerTracker.UI.fsproj ./PrayerTracker.UI/
RUN dotnet restore
COPY . ./
WORKDIR /pt/PrayerTracker.Tests
RUN dotnet run
WORKDIR /pt/PrayerTracker
RUN dotnet publish -c Release -r linux-x64
FROM mcr.microsoft.com/dotnet/aspnet:7.0-alpine as final
WORKDIR /app
RUN apk add --no-cache icu-libs
ENV DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=false
COPY --from=build /pt/PrayerTracker/bin/Release/net7.0/linux-x64/publish/ ./
EXPOSE 80
CMD [ "dotnet", "/app/PrayerTracker.dll" ]