Skip to content

Commit

Permalink
Merge branch 'dev' into vf
Browse files Browse the repository at this point in the history
  • Loading branch information
vicancy authored Dec 6, 2024
2 parents b06d51d + 3f2a64a commit 5961fd2
Show file tree
Hide file tree
Showing 42 changed files with 1,887 additions and 1,547 deletions.
8 changes: 4 additions & 4 deletions samples/ChatSample/ChatSample/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,24 @@
# Build stage
##################################################

FROM mcr.microsoft.com/dotnet/core/sdk:8.0
FROM mcr.microsoft.com/dotnet/sdk:8.0

COPY ./ /home/signalr-src

WORKDIR /home/signalr-src/samples/ChatSample/ChatSample
RUN dotnet build && \
dotnet publish -r ubuntu.16.04-x64 -c Release -o /home/build/
dotnet publish -r linux-x64 -c Release -o /home/build/

##################################################
# Final stage
##################################################

FROM mcr.microsoft.com/dotnet/core/runtime:8.0
FROM mcr.microsoft.com/dotnet/aspnet:8.0

COPY --from=0 /home/build/ /home/SignalR

WORKDIR /home/SignalR

EXPOSE 5050

CMD ["./ChatSample"]
CMD ["./ChatSample", "--urls", "http://0.0.0.0:5050"]
80 changes: 80 additions & 0 deletions samples/ChatSample/ChatSample/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
# Azure SignalR Service Chat Sample

This sample demonstrates how to use Azure SignalR Service with ASP.NET Core SignalR.

## Prerequisites

- .NET 8.0 SDK or later
- An Azure SignalR Service instance
- Git (for submodule dependencies)
- Docker (optional, for containerized deployment)

## Setup

1. Initialize the required submodules:

```bash
git submodule update --init --recursive
```

2. Configure your Azure SignalR Service connection string:

- Update `appsettings.json` by replacing the empty connection string:

```json
{
"Azure": {
"SignalR": {
"ConnectionString": "<your-connection-string>"
}
}
}
```

⚠️ **Important**: Make sure to set your connection string before building the Docker image or running the application.

## Running the Sample

### Option 1: Running Locally

1. Build and run the project:

```bash
dotnet build
dotnet run
```

You can also specify a custom port:

```bash
dotnet run --urls="http://localhost:5050"
```

### Option 2: Running with Docker

1. Build the Docker image:
```bash
docker build -t chat-app -f samples/ChatSample/ChatSample/Dockerfile .
```

2. Run the container:
```bash
docker run -d -p 5050:5050 chat-app
```

Additional Docker commands:
```bash
# View running containers
docker ps

# View container logs
docker logs <container_id>

# Stop the container
docker stop <container_id>
```

## Accessing the Application

To access the chat application, open your web browser and navigate to:
- `http://localhost:5050` (or the custom port you specified)
Loading

0 comments on commit 5961fd2

Please sign in to comment.