WIP
This commit is contained in:
1 parent
75d804b7ff
commit
d01ae59dc0
3 files changed
+23
-1
No files matched your search
Binary file not shown.
Binary file not shown.
+23
-1
@@ -1,7 +1,8 @@
|
|||||||
FROM mcr.microsoft.com/dotnet/aspnet:10.0-preview AS base
|
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
|
WORKDIR /app
|
||||||
EXPOSE 8080
|
EXPOSE 8080
|
||||||
|
EXPOSE 8443
|
||||||
|
|
||||||
FROM mcr.microsoft.com/dotnet/sdk:10.0-preview AS build
|
FROM mcr.microsoft.com/dotnet/sdk:10.0-preview AS build
|
||||||
WORKDIR /src
|
WORKDIR /src
|
||||||
@@ -31,6 +32,27 @@ LABEL org.opencontainers.image.title="Budgeteer" \
|
|||||||
# Ensure the SQLite data directory exists and is writable
|
# Ensure the SQLite data directory exists and is writable
|
||||||
RUN mkdir -p /app/data
|
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
|
# Store the database in the volume-mountable /app/data directory
|
||||||
ENV ConnectionStrings__DefaultConnection="Data Source=/app/data/budgetapp.db"
|
ENV ConnectionStrings__DefaultConnection="Data Source=/app/data/budgetapp.db"
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user