Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
FROM mcr.microsoft.com/dotnet/sdk:9.0
# Build stage
FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build
WORKDIR /src

# copy solution and project files
# Copy solution and project files
COPY ["PayrollEngine.PayrollConsole.sln", "./"]
COPY ["PayrollConsole/PayrollEngine.PayrollConsole.csproj", "PayrollConsole/"]
COPY ["Commands/PayrollEngine.PayrollConsole.Commands.csproj", "Commands/"]

# copy Directory.Build.props
COPY ["Directory.Build.props", "./"]

# Restore dependencies (cached layer)
RUN dotnet restore "PayrollEngine.PayrollConsole.sln"

# copy everything else
# Copy remaining source files and publish
COPY . .
WORKDIR "/src/PayrollConsole"
RUN dotnet publish "PayrollEngine.PayrollConsole.csproj" -c Release -o /app/publish
RUN dotnet publish "PayrollEngine.PayrollConsole.csproj" -c Release -o /app/publish --no-restore

# final stage
FROM mcr.microsoft.com/dotnet/runtime:9.0
# Runtime stage
FROM mcr.microsoft.com/dotnet/aspnet:9.0
WORKDIR /app
COPY --from=0 /app/publish .
ENTRYPOINT ["dotnet", "PayrollEngine.PayrollConsole.dll"]
COPY --from=build /app/publish .
ENTRYPOINT ["dotnet", "PayrollEngine.PayrollConsole.dll"]
14 changes: 6 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -204,17 +204,15 @@ The payroll console stores its logs in the application folder `logs`.
## Docker Support
Build the Docker image:
```bash
docker build -t payroll-console .
docker build --no-cache -t payroll-console .
```

Run the Docker Payroll Console:
Run the container to deploy the examples/local files with the environment variable (if appsettings.json is not used):
```bash
docker run -it --rm payroll-console Setup.pecmd
```

Delete the Docker image:
```bash
docker stop payroll-console
docker run -it --rm \
-e PayrollApiConnection="baseUrl=http://<backend-url>;port=<backend-port>;..." \
-v "$(pwd)/PayrollEngine/examples":/examples \
payroll-console /examples/Setup.All.pecmd
```

## Solution projects
Expand Down