DevToolsHub Free · Fast · 100% in your browser

Dockerfile & GitHub Actions Generator

Generate a production-ready multi-stage Dockerfile, .dockerignore and GitHub Actions CI workflow for .NET, Node.js and Python apps.

Dockerfile
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
WORKDIR /src
COPY ["MyApp.csproj", "./"]
RUN dotnet restore "MyApp.csproj"
COPY . .
RUN dotnet publish "MyApp.csproj" -c Release -o /app/publish /p:UseAppHost=false

FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS final
WORKDIR /app
ENV ASPNETCORE_HTTP_PORTS=8080
EXPOSE 8080
COPY --from=build /app/publish .
USER $APP_UID
ENTRYPOINT ["dotnet", "MyApp.dll"]
.dockerignore
**/bin
**/obj
**/.vs
**/.vscode
**/*.user
.git
Dockerfile
.dockerignore

GitHub Actions workflow

Save as .github/workflows/ci.yml.

name: CI

on:
  push:
    branches: [ "main" ]
  pull_request:
    branches: [ "main" ]

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-dotnet@v4
        with:
          dotnet-version: '8.0.x'
      - run: dotnet restore
      - run: dotnet build --no-restore -c Release
      - run: dotnet test --no-build -c Release --verbosity normal

About this Dockerfile and GitHub Actions generator

Generate a production-ready multi-stage Dockerfile for .NET, Node.js or Python that runs as a non-root user, a matching .dockerignore, and a GitHub Actions CI workflow that restores, builds and tests your code and can push a container image to GitHub Container Registry.

How to use the Dockerfile & GitHub Actions Generator

  1. Choose your stack and version.
  2. Set the port, project name or start command.
  3. Copy the Dockerfile, .dockerignore and .github/workflows/ci.yml.

Frequently asked questions

Why use a multi-stage Dockerfile?

The SDK and build tools stay in the build stage, so the final image only contains the runtime and your app. It is smaller and more secure.

Do I need a secret to push to GHCR?

No. The workflow uses the built-in GITHUB_TOKEN with packages: write permission.

Is my data safe?

Yes. The tool runs entirely in your browser using WebAssembly. Nothing you type or upload is sent to a server, logged or stored.

Is it free?

Yes, completely free with no sign-up, no limits and no watermarks. It also works offline once the page has loaded.

An unhandled error has occurred. Reload ✕