Skip to content

Commit acf0dc3

Browse files
committed
fix: Update environment variables for Docker compatibility in .env.example and README
1 parent 1607478 commit acf0dc3

File tree

3 files changed

+16
-5
lines changed

3 files changed

+16
-5
lines changed

.env.example

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# .env.example - Environment variable template for auth_api
22

3-
DB_HOST=localhost
3+
DB_HOST=postgres
44
DB_PORT=5432
55
DB_USER=postgres
66
DB_PASSWORD=your_db_password
@@ -10,7 +10,8 @@ JWT_SECRET=your_jwt_secret
1010
ACCESS_TOKEN_EXPIRATION_MINUTES=15
1111
REFRESH_TOKEN_EXPIRATION_HOURS=720
1212

13-
REDIS_ADDR=localhost:6379
13+
# Use 'redis:6379' for Docker Compose, 'localhost:6379' for local/manual run
14+
REDIS_ADDR=redis:6379
1415
REDIS_PASSWORD=your_redis_password
1516
REDIS_DB=0
1617

Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@ lint:
4545
build-prod:
4646
CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o bin/api ./cmd/api
4747

48+
docker-dev:
49+
./dev.sh
50+
4851
# Docker build
4952
docker-build:
5053
docker build -t auth-api .

README.md

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,13 +80,20 @@ If you discover a vulnerability, please open an issue or contact the maintainer
8080

8181
## ⚙️ Environment Variables (example)
8282
```
83-
DB_HOST=localhost
83+
# For Docker Compose:
84+
DB_HOST=postgres
8485
DB_PORT=5432
86+
REDIS_ADDR=redis:6379
87+
88+
# For manual/local run:
89+
# DB_HOST=localhost
90+
# DB_PORT=5432
91+
# REDIS_ADDR=localhost:6379
92+
8593
DB_USER=your_db_user
8694
DB_PASSWORD=your_db_password
87-
DB_NAME=your_db_name
95+
DB_NAME=auth_db
8896
JWT_SECRET=supersecretjwtkey
89-
REDIS_ADDR=localhost:6379
9097
EMAIL_HOST=smtp.example.com
9198
9299
GOOGLE_CLIENT_ID=your_google_client_id

0 commit comments

Comments
 (0)