You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: apps/matching-service/README.md
+25-3Lines changed: 25 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -27,7 +27,7 @@ go mod tidy
27
27
-`PORT`: Specifies the port for the WebSocket server. Default is `8081`.
28
28
-`JWT_SECRET`: The secret key used to verify JWT tokens.
29
29
-`MATCH_TIMEOUT`: The time in seconds to wait for a match before timing out.
30
-
-`REDIS_URL`: The URL for the Redis server. Default is `localhost:6379`.
30
+
-`REDIS_URL`: The URL for the Redis server. Default is `localhost:6379`. If you are using docker, use `redis-container:6379`
31
31
32
32
4. Start a local Redis server:
33
33
@@ -121,6 +121,28 @@ Make sure to open the HTML file in a web browser while the WebSocket server is r
121
121
122
122
You can open one instance of the HTML file in multiple tabs to simulate multiple clients connecting to the server. (In the future: ensure that only one connection is allowed per user)
123
123
124
-
## Docker Support
124
+
## Running the Application via Docker
125
125
126
-
TODO: Add section for Docker setup and usage instructions.
126
+
Before running the following commands, ensure that the URL for the Redis server in `.env` file has been changed to `REDIS_URL=redis-container:6379`
127
+
128
+
To run the application via Docker, run the following command:
129
+
130
+
1. Set up the Go Docker container for the matching service
131
+
```bash
132
+
docker build -f Dockerfile -t match-go-app .
133
+
```
134
+
135
+
2. Create the Docker network for Redis and Go
136
+
```bash
137
+
docker network create redis-go-network
138
+
```
139
+
140
+
3. Start a new Redis container in detached mode using the Redis image from Docker Hub
141
+
```bash
142
+
docker run -d --name redis-container --network redis-go-network redis
143
+
```
144
+
145
+
4. Run the Go Docker container for the matching-service
146
+
```bash
147
+
docker run -d -p 8081:8081 --name go-app-container --network redis-go-network match-go-app
0 commit comments