Files
ElsaWorkflow/Dockerfile
Claude 1047f1e0b8 Embed Elsa Studio Blazor WASM in the same host
- Elsa.Studio.Wasm project (net9.0): WASM shell with Login/Dashboard/Workflows modules,
  reads its backend URL from a JS-injected window.getClientConfig() so the same build
  can point at any origin without a rebuild.
- Elsa.CustomServer:
    - references Elsa.Studio.Wasm as a project so `dotnet publish` emits its wwwroot/
    - UseBlazorFrameworkFiles + MapFallbackToPage('/_Host') serve the WASM app + SPA routes
    - Pages/_Host.cshtml renders the Studio shell and injects apiUrl at request time
- Bumped Elsa server packages to 3.5.3, Studio packages to 3.7.0 (Studio release train
  moved ahead of server; 3.7 Studio is compatible with 3.5 server API)
- Dockerfile: SDK/runtime 9.0, restores both csprojs before copying sources
2026-09-02 08:35:20 +00:00

32 lines
1.1 KiB
Docker

# Elsa Custom Server — Docker image
# Multi-stage build so the final image only carries the ASP.NET runtime.
FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build
WORKDIR /source
# Restore first for better layer caching.
COPY src/Elsa.CustomServer/Elsa.CustomServer.csproj src/Elsa.CustomServer/
COPY src/Elsa.Studio.Wasm/Elsa.Studio.Wasm.csproj src/Elsa.Studio.Wasm/
RUN dotnet restore src/Elsa.CustomServer/Elsa.CustomServer.csproj
# Then copy the rest and publish.
COPY src/ src/
RUN dotnet publish src/Elsa.CustomServer/Elsa.CustomServer.csproj \
-c Release -o /app/publish --no-restore /p:UseAppHost=false
FROM mcr.microsoft.com/dotnet/aspnet:9.0 AS runtime
WORKDIR /app
COPY --from=build /app/publish ./
# Ensure the SQLite DB and any workflow blobs land on a writable path we can volume-mount.
RUN mkdir -p /app/App_Data && chmod 777 /app/App_Data
VOLUME ["/app/App_Data"]
# Kestrel binds to whatever HTTP_PORTS says; keep the container port fixed so Coolify
# can wire Traefik consistently.
ENV ASPNETCORE_URLS=http://+:8080
ENV HTTP_PORTS=8080
EXPOSE 8080
ENTRYPOINT ["dotnet", "Elsa.CustomServer.dll"]