Files
ElsaWorkflow/Dockerfile
Claude 75d250b7f7 Initial scaffold: Elsa 3.5 custom API server with sample Shout activity
- src/Elsa.CustomServer: minimal ASP.NET Core 8 host referencing Elsa 3.5 NuGets
- Activities auto-registered via AddActivitiesFrom<Program>() — drop new files under Activities/
- Sqlite persistence for workflow definitions + runtime
- Multi-stage Dockerfile targeting linux/amd64, ASP.NET 8 runtime, port 8080
- Forwarded-headers configured so URLs come out https:// behind Traefik
- CORS wide-open so the standalone Studio (different origin) can talk to us
2026-09-02 08:09:20 +00:00

31 lines
1.0 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:8.0 AS build
WORKDIR /source
# Restore first for better layer caching.
COPY src/Elsa.CustomServer/Elsa.CustomServer.csproj src/Elsa.CustomServer/
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:8.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"]