Skip to content

Commit 0bc8ccb

Browse files
Fix Redis Connection and Docker Configuration for Gin Application
1 parent 1cb8767 commit 0bc8ccb

4 files changed

Lines changed: 71 additions & 2 deletions

File tree

echo-mysql/echo-mysql

10.8 MB
Binary file not shown.

gin-redis/docker-compose.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,15 @@ services:
66
container_name: ginRedisApp
77
ports:
88
- "3001:3001"
9+
environment:
10+
- REDIS_HOST=myredis
11+
- REDIS_PORT=6379
912
depends_on:
1013
- redis
1114
redis:
1215
image: redis
1316
container_name: myredis
1417
ports:
15-
- "6379:6379"
18+
- "6379:6379"
19+
20+

gin-redis/helpers/redis/redisConnect.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ func Session() *redis.Client {
1717
func Init() {
1818
// Connect to the Redis server
1919
RedisClient = redis.NewClient(&redis.Options{
20-
Addr: "localhost:6379", // Redis server address
20+
Addr: "redis:6379", // Redis server address
2121
Password: "", // No password for local Redis, set it if needed
2222
DB: 0, // Default DB
2323
})

gin-redis/keploy.yml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# Generated by Keploy (2.4.16)
2+
path: ""
3+
appId: 0
4+
appName: gin-redis
5+
command: docker run -p 3001:3001 --network <networkName> --name ginRedisApp gin-app:1.0
6+
templatize:
7+
testSets: []
8+
port: 0
9+
e2e: false
10+
dnsPort: 26789
11+
proxyPort: 16789
12+
debug: false
13+
disableTele: false
14+
disableANSI: false
15+
containerName: ""
16+
networkName: ""
17+
buildDelay: 30
18+
test:
19+
selectedTests: {}
20+
globalNoise:
21+
global: {}
22+
test-sets: {}
23+
delay: 5
24+
host: ""
25+
port: 0
26+
apiTimeout: 5
27+
skipCoverage: false
28+
coverageReportPath: ""
29+
ignoreOrdering: true
30+
mongoPassword: default@123
31+
language: ""
32+
removeUnusedMocks: false
33+
fallBackOnMiss: false
34+
jacocoAgentPath: ""
35+
basePath: ""
36+
mocking: true
37+
ignoredTests: {}
38+
disableLineCoverage: false
39+
disableMockUpload: true
40+
useLocalMock: false
41+
updateTemplate: false
42+
record:
43+
filters: []
44+
basePath: ""
45+
recordTimer: 0s
46+
configPath: ""
47+
bypassRules: []
48+
generateGithubActions: false
49+
keployContainer: keploy-v2
50+
keployNetwork: keploy-network
51+
cmdType: native
52+
contract:
53+
services: []
54+
tests: []
55+
path: ""
56+
download: false
57+
generate: false
58+
driven: consumer
59+
mappings:
60+
servicesMapping: {}
61+
self: s1
62+
inCi: false
63+
64+
# Visit [https://keploy.io/docs/running-keploy/configuration-file/] to learn about using keploy through configration file.

0 commit comments

Comments
 (0)