From dce80fdddcf55c5ccc313b43cf7b4f99b701ceb9 Mon Sep 17 00:00:00 2001 From: "Daniel J. Summers" Date: Fri, 22 Mar 2024 21:32:35 -0400 Subject: [PATCH] Fix theme zipping in Docker (#38) - Default to port 80 --- src/.dockerignore | 2 ++ src/Dockerfile | 11 ++++++----- src/MyWebLog/appsettings.json | 7 +++++++ src/sqlite.Dockerfile | 11 ++++++----- 4 files changed, 21 insertions(+), 10 deletions(-) diff --git a/src/.dockerignore b/src/.dockerignore index f181d71..147d38c 100644 --- a/src/.dockerignore +++ b/src/.dockerignore @@ -1,2 +1,4 @@ **/bin **/obj +**/*.db +**/appsettings.*.json diff --git a/src/Dockerfile b/src/Dockerfile index cb3fbd5..89387d5 100644 --- a/src/Dockerfile +++ b/src/Dockerfile @@ -14,11 +14,12 @@ RUN dotnet publish -f net8.0 -c Release -r linux-x64 --no-self-contained -p:Publ 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/* +WORKDIR /themes/default-theme +COPY ./default-theme ./ +RUN zip -r ../default-theme.zip ./* +WORKDIR /themes/admin-theme +COPY ./admin-theme ./ +RUN zip -r ../admin-theme.zip ./* FROM mcr.microsoft.com/dotnet/aspnet:8.0-alpine as final WORKDIR /app diff --git a/src/MyWebLog/appsettings.json b/src/MyWebLog/appsettings.json index 102b5a3..d4c8a33 100644 --- a/src/MyWebLog/appsettings.json +++ b/src/MyWebLog/appsettings.json @@ -4,5 +4,12 @@ "LogLevel": { "MyWebLog.Handlers": "Information" } + }, + "Kestrel": { + "Endpoints": { + "Http": { + "Url": "http://0.0.0.0:80" + } + } } } diff --git a/src/sqlite.Dockerfile b/src/sqlite.Dockerfile index fe57963..35929b7 100644 --- a/src/sqlite.Dockerfile +++ b/src/sqlite.Dockerfile @@ -14,11 +14,12 @@ RUN dotnet publish -f net8.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/* +WORKDIR /themes/default-theme +COPY ./default-theme ./ +RUN zip -r ../default-theme.zip ./* +WORKDIR /themes/admin-theme +COPY ./admin-theme ./ +RUN zip -r ../admin-theme.zip ./* FROM mcr.microsoft.com/dotnet/aspnet:8.0 as final WORKDIR /app