From df62732e3ecc50990fc14ec56e59f93988f8037d Mon Sep 17 00:00:00 2001 From: Jonas Hendrickx Date: Sat, 31 Aug 2024 12:00:41 +0200 Subject: [PATCH 1/4] Fix mailing on Passwordless Test API image --- Api.dockerfile | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Api.dockerfile b/Api.dockerfile index d093fde4a..f25109225 100644 --- a/Api.dockerfile +++ b/Api.dockerfile @@ -37,6 +37,11 @@ LABEL org.opencontainers.image.source="https://github.com/passwordless/passwordl EXPOSE $ASPNETCORE_HTTP_PORTS +RUN mkdir -p /app +ENV MAIL__FROM = "test@lesspassword.dev" +ENV MAIL__PROVIDERS__0__NAME = "file" +ENV MAIL__PROVIDERS__0__PATH = "/app/mail.md" + # Alpine image doesn't come with the ICU libraries pre-installed, so we need to install them manually. # Technically, we shouldn't need globalization support in the API, but some EF queries fail without it at the moment. # `libsodium` is required by the `NSec.Cryptography` package. From 5ddc41931ccc95b4967196698e2d4e8472060e98 Mon Sep 17 00:00:00 2001 From: Jonas Hendrickx Date: Mon, 2 Sep 2024 09:55:05 +0200 Subject: [PATCH 2/4] fix --- Api.dockerfile | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/Api.dockerfile b/Api.dockerfile index f25109225..74be68d8a 100644 --- a/Api.dockerfile +++ b/Api.dockerfile @@ -37,11 +37,6 @@ LABEL org.opencontainers.image.source="https://github.com/passwordless/passwordl EXPOSE $ASPNETCORE_HTTP_PORTS -RUN mkdir -p /app -ENV MAIL__FROM = "test@lesspassword.dev" -ENV MAIL__PROVIDERS__0__NAME = "file" -ENV MAIL__PROVIDERS__0__PATH = "/app/mail.md" - # Alpine image doesn't come with the ICU libraries pre-installed, so we need to install them manually. # Technically, we shouldn't need globalization support in the API, but some EF queries fail without it at the moment. # `libsodium` is required by the `NSec.Cryptography` package. @@ -50,9 +45,16 @@ ENV DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=false # Use the default non-root user for the app. # This instruction must appear after all other instructions that require elevated access. +RUN mkdir -p /app +RUN chmod 666 /app USER $APP_UID WORKDIR /opt/app/ COPY --from=build /tmp/app/src/Api/bin/publish ./ +# TODO +ENV MAIL__FROM = "test@lesspassword.dev" +ENV MAIL__PROVIDERS__0__NAME = "file" +ENV MAIL__PROVIDERS__0__PATH = "/app/mail.md" + ENTRYPOINT ["./Passwordless.Api"] \ No newline at end of file From 2a44767660cad95378a0f6fd7f02938f7f9a3dbc Mon Sep 17 00:00:00 2001 From: Jonas Hendrickx Date: Mon, 2 Sep 2024 10:30:25 +0200 Subject: [PATCH 3/4] f --- Api.dockerfile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Api.dockerfile b/Api.dockerfile index 74be68d8a..ac471a67f 100644 --- a/Api.dockerfile +++ b/Api.dockerfile @@ -46,13 +46,12 @@ ENV DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=false # Use the default non-root user for the app. # This instruction must appear after all other instructions that require elevated access. RUN mkdir -p /app -RUN chmod 666 /app +RUN chmod 777 /app USER $APP_UID WORKDIR /opt/app/ COPY --from=build /tmp/app/src/Api/bin/publish ./ -# TODO ENV MAIL__FROM = "test@lesspassword.dev" ENV MAIL__PROVIDERS__0__NAME = "file" ENV MAIL__PROVIDERS__0__PATH = "/app/mail.md" From be891ca2ed30f81558377aeed3847465777df434 Mon Sep 17 00:00:00 2001 From: Jonas Hendrickx Date: Mon, 2 Sep 2024 10:42:06 +0200 Subject: [PATCH 4/4] fix --- Api.dockerfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Api.dockerfile b/Api.dockerfile index ac471a67f..426f84e3a 100644 --- a/Api.dockerfile +++ b/Api.dockerfile @@ -52,8 +52,8 @@ USER $APP_UID WORKDIR /opt/app/ COPY --from=build /tmp/app/src/Api/bin/publish ./ -ENV MAIL__FROM = "test@lesspassword.dev" -ENV MAIL__PROVIDERS__0__NAME = "file" -ENV MAIL__PROVIDERS__0__PATH = "/app/mail.md" +ENV MAIL__FROM="test@lesspassword.dev" +ENV MAIL__PROVIDERS__0__NAME="file" +ENV MAIL__PROVIDERS__0__PATH="/app/mail.md" ENTRYPOINT ["./Passwordless.Api"] \ No newline at end of file