From 295e60502cbdc903d74ccbd320b12ae9d576b066 Mon Sep 17 00:00:00 2001 From: Douwe Ravers Date: Fri, 24 Apr 2026 12:28:53 +0200 Subject: [PATCH] Added docker compose file for deployment on server. --- Dockerfile | 34 ++++++++++++++++++++++++++++++++++ docker-compose.yml | 10 ++++++++++ 2 files changed, 44 insertions(+) create mode 100644 Dockerfile create mode 100644 docker-compose.yml diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..68f393f --- /dev/null +++ b/Dockerfile @@ -0,0 +1,34 @@ +# Build stage +FROM mcr.microsoft.com/dotnet/sdk:10.0 AS launch +WORKDIR /src + +# Install Python (required for AOT compilation) +RUN apt-get update && \ + apt-get install -y python3 && \ + ln -s /usr/bin/python3 /usr/bin/python + + +# Update workloads and SDK +RUN dotnet --list-sdks +RUN dotnet --list-runtimes +RUN dotnet workload update + +# Copy project and solution files +COPY *.csproj *.sln ./ + +# Install required workloads +RUN dotnet workload install wasm-tools + +# Copy the rest of the application +COPY . . + +# Restore dependencies +RUN dotnet restore + +# Publish the app (optional, if you want to test publish output) +# RUN dotnet publish -c Release -o /app/publish + +# Runtime stage: Use the SDK image to run the app +ENTRYPOINT ["dotnet", "run", "--no-launch-profile", "--urls", "http://0.0.0.0:8080"] +EXPOSE 8080 + diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..192d3bc --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,10 @@ +version: '3.8' + +services: + web: + build: + context: . + dockerfile: Dockerfile + ports: + - "8080:8080" + restart: unless-stopped