diff --git a/BudgetApp/budgetapp.db-shm b/BudgetApp/budgetapp.db-shm index 3d42b32..ae84a42 100644 Binary files a/BudgetApp/budgetapp.db-shm and b/BudgetApp/budgetapp.db-shm differ diff --git a/BudgetApp/budgetapp.db-wal b/BudgetApp/budgetapp.db-wal index 2330d1f..8e2fd71 100644 Binary files a/BudgetApp/budgetapp.db-wal and b/BudgetApp/budgetapp.db-wal differ diff --git a/Dockerfile b/Dockerfile index 279bdaa..6cc1625 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,8 @@ FROM mcr.microsoft.com/dotnet/aspnet:10.0-preview AS base -RUN apt-get update && apt-get upgrade -y && rm -rf /var/lib/apt/lists/* +RUN apt-get update && apt-get upgrade -y && apt-get install -y openssl && rm -rf /var/lib/apt/lists/* WORKDIR /app EXPOSE 8080 +EXPOSE 8443 FROM mcr.microsoft.com/dotnet/sdk:10.0-preview AS build WORKDIR /src @@ -31,6 +32,27 @@ LABEL org.opencontainers.image.title="Budgeteer" \ # Ensure the SQLite data directory exists and is writable RUN mkdir -p /app/data +# Generate a self-signed TLS certificate for HTTPS +RUN mkdir -p /app/certs && \ + openssl req -x509 -newkey rsa:4096 \ + -keyout /app/certs/key.pem \ + -out /app/certs/cert.pem \ + -days 3650 \ + -nodes \ + -subj "/C=GB/ST=England/O=Budgeteer/CN=localhost" && \ + openssl pkcs12 -export \ + -out /app/certs/cert.pfx \ + -inkey /app/certs/key.pem \ + -in /app/certs/cert.pem \ + -passout pass: && \ + rm /app/certs/key.pem /app/certs/cert.pem + +# Serve on both HTTP and HTTPS +ENV ASPNETCORE_HTTP_PORTS=8181 +ENV ASPNETCORE_HTTPS_PORTS=8282 +ENV ASPNETCORE_Kestrel__Certificates__Default__Path=/app/certs/cert.pfx +ENV ASPNETCORE_Kestrel__Certificates__Default__Password="" + # Store the database in the volume-mountable /app/data directory ENV ConnectionStrings__DefaultConnection="Data Source=/app/data/budgetapp.db"