First cut of Docker files (#38)

- Fix canonical domain config detection (#37)
- Fix version insert for new SQLite dbs
- Bump version to 2.1
This commit is contained in:
2023-07-08 21:26:11 -04:00
parent 5b27ea5cd2
commit 5f5927c425
5 changed files with 37 additions and 6 deletions

28
src/Dockerfile Normal file
View File

@@ -0,0 +1,28 @@
FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build
WORKDIR /mwl
COPY ./MyWebLog.sln ./
COPY ./Directory.Build.props ./
COPY ./MyWebLog/MyWebLog.fsproj ./MyWebLog/
COPY ./MyWebLog.Data/MyWebLog.Data.fsproj ./MyWebLog.Data/
COPY ./MyWebLog.Domain/MyWebLog.Domain.fsproj ./MyWebLog.Domain/
RUN dotnet restore
COPY . ./
WORKDIR /mwl/MyWebLog
RUN dotnet publish -f net7.0 -c Release -r linux-x64
FROM alpine AS theme
RUN apk add --no-cache zip
WORKDIR /themes
COPY ./default-theme ./default-theme/
RUN zip default-theme.zip ./default-theme/*
COPY ./admin-theme ./admin-theme/
RUN zip admin-theme.zip ./admin-theme/*
FROM mcr.microsoft.com/dotnet/aspnet:7.0 as final
WORKDIR /app
COPY --from=build /mwl/MyWebLog/bin/Release/net7.0/linux-x64/publish/ ./
COPY --from=theme /themes/*.zip /app/
EXPOSE 80
CMD [ "/app/MyWebLog" ]