fix readme docker compose commands
This commit is contained in:
parent
d91eb82a4a
commit
e5553e56fb
18
README.md
18
README.md
|
|
@ -18,7 +18,7 @@ A simple NATS client/server setup for testing message publishing and subscribing
|
||||||
### 1. Start the NATS server and message subscriber
|
### 1. Start the NATS server and message subscriber
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
docker-compose up nats server -d
|
docker compose up nats server
|
||||||
```
|
```
|
||||||
|
|
||||||
This starts:
|
This starts:
|
||||||
|
|
@ -29,7 +29,7 @@ This starts:
|
||||||
### 2. Run the interactive client
|
### 2. Run the interactive client
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
docker-compose run --rm client
|
docker compose run --rm client
|
||||||
```
|
```
|
||||||
|
|
||||||
This opens an interactive prompt where you can:
|
This opens an interactive prompt where you can:
|
||||||
|
|
@ -43,13 +43,13 @@ This opens an interactive prompt where you can:
|
||||||
To see incoming messages in real-time:
|
To see incoming messages in real-time:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
docker-compose logs -f server
|
docker compose logs -f server
|
||||||
```
|
```
|
||||||
|
|
||||||
### 4. Stop everything
|
### 4. Stop everything
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
docker-compose down
|
docker compose down
|
||||||
```
|
```
|
||||||
|
|
||||||
## Example Usage
|
## Example Usage
|
||||||
|
|
@ -57,13 +57,13 @@ docker-compose down
|
||||||
1. **Terminal 1**: Start the infrastructure
|
1. **Terminal 1**: Start the infrastructure
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
docker-compose up nats server -d
|
docker compose up nats server -d
|
||||||
```
|
```
|
||||||
|
|
||||||
2. **Terminal 2**: Run the client
|
2. **Terminal 2**: Run the client
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
docker-compose run --rm client
|
docker compose run --rm client
|
||||||
```
|
```
|
||||||
|
|
||||||
You'll see:
|
You'll see:
|
||||||
|
|
@ -78,7 +78,7 @@ docker-compose down
|
||||||
|
|
||||||
3. **Terminal 1**: Check server logs to see received messages
|
3. **Terminal 1**: Check server logs to see received messages
|
||||||
```bash
|
```bash
|
||||||
docker-compose logs server
|
docker compose logs server
|
||||||
```
|
```
|
||||||
|
|
||||||
## Local Development (without Docker)
|
## Local Development (without Docker)
|
||||||
|
|
@ -115,8 +115,8 @@ bun run client.ts
|
||||||
|
|
||||||
## Troubleshooting
|
## Troubleshooting
|
||||||
|
|
||||||
- **Client not accepting input**: Make sure you're using `docker-compose run --rm client` instead of `docker-compose up client`
|
- **Client not accepting input**: Make sure you're using `docker compose run --rm client` instead of `docker compose up client`
|
||||||
- **Connection refused**: Ensure NATS server is running first
|
- **Connection refused**: Ensure NATS server is running first
|
||||||
- **Messages not appearing**: Check that the server container is running with `docker-compose ps`
|
- **Messages not appearing**: Check that the server container is running with `docker compose ps`
|
||||||
|
|
||||||
This project was created using `bun init` in bun v1.2.18. [Bun](https://bun.sh) is a fast all-in-one JavaScript runtime.
|
This project was created using `bun init` in bun v1.2.18. [Bun](https://bun.sh) is a fast all-in-one JavaScript runtime.
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue