Compare commits

...

2 Commits

Author SHA1 Message Date
10bd7f1ca6 Update ReadMe.md 2026-08-15 08:45:14 +00:00
douwe
5a3c2228b6 Updated docker config to work on the server. 2026-08-12 10:36:15 +00:00
5 changed files with 36 additions and 24 deletions

View File

@@ -6,9 +6,6 @@
<ImplicitUsings>enable</ImplicitUsings>
<OverrideHtmlAssetPlaceholders>true</OverrideHtmlAssetPlaceholders>
<ServiceWorkerAssetsManifest>service-worker-assets.js</ServiceWorkerAssetsManifest>
<WasmAllowUndefinedSymbols>true</WasmAllowUndefinedSymbols>
<RunAOTCompilation>true</RunAOTCompilation>
<WasmShellGenerateAOTProfile>true</WasmShellGenerateAOTProfile>
</PropertyGroup>
<ItemGroup>

View File

@@ -1,5 +1,5 @@
# Build stage
FROM mcr.microsoft.com/dotnet/sdk:10.0 AS launch
FROM mcr.microsoft.com/dotnet/sdk:10.0 AS build
WORKDIR /src
# Install Python (required for AOT compilation)
@@ -7,28 +7,21 @@ 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 project and solution files
COPY *.csproj ./
RUN dotnet restore
# 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:5000"]
EXPOSE 5000
# Publish the app
RUN dotnet publish -c Release -o /app/publish
# Runtime stage: Use Nginx to serve static files
FROM nginx:alpine
COPY --from=build /app/publish/wwwroot /usr/share/nginx/html
COPY nginx.conf /etc/nginx/conf.d/default.conf
EXPOSE 80

View File

@@ -2,6 +2,8 @@
**Watt if?** is a simulation tool designed to help Flemish homeowners evaluate the impact of energy improvements such as batteries, heat pumps, solar panels, and air conditioning on their **energy bills** and **carbon emissions**. Currently, Wattif works exclusively with data from **Fluvius**, the Flemish energy distribution company.
You can find it at : [wattif.douwco.be](https://wattif.douwco.be/)
---
## How It Works

View File

@@ -1,10 +1,12 @@
version: '3.8'
services:
web:
wattif:
build:
context: .
dockerfile: Dockerfile
ports:
- "5000:5000"
- "5000:80"
restart: unless-stopped
volumes:
- ./nginx.conf:/etc/nginx/conf.d/default.conf

18
nginx.conf Normal file
View File

@@ -0,0 +1,18 @@
server {
listen 80;
server_name _;
root /usr/share/nginx/html;
index index.html;
location / {
try_files $uri $uri/ /index.html =404;
}
include /etc/nginx/mime.types;
types {
application/wasm wasm;
application/manifest+json webmanifest;
application/octet-stream dll pdb webcil;
}
}