Skip to content

Commit 013d2d0

Browse files
committed
Change default port from 8000 to 3001 to avoid conflicts
1 parent 7c51c12 commit 013d2d0

File tree

7 files changed

+12
-47
lines changed

7 files changed

+12
-47
lines changed

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ COPY . .
99

1010
RUN mkdir -p /app/data
1111

12-
EXPOSE 8000
12+
EXPOSE 3001
1313

1414
HEALTHCHECK --interval=30s --timeout=30s --start-period=5s --retries=3 \
15-
CMD python -c "import requests; requests.get('http://localhost:8000/health')" || exit 1
15+
CMD python -c "import requests; requests.get('http://localhost:3001/health')" || exit 1
1616

1717
CMD ["python", "main.py"]

README.md

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -38,31 +38,7 @@ pip install -r requirements.txt
3838
python main.py
3939
```
4040

41-
Visit `http://localhost:8000/docs` for API documentation.
42-
43-
## 🐳 Docker Deployment
44-
45-
### Quick Start
46-
```bash
47-
git clone https://github.com/yourusername/githitbox
48-
cd githitbox
49-
docker-compose up -d
50-
```
51-
52-
### Production Deployment
53-
```bash
54-
# On your server
55-
git clone https://github.com/yourusername/githitbox
56-
cd githitbox
57-
58-
# Set up environment variables
59-
cp .env.example .env
60-
# Edit .env with your database URL
61-
62-
# Deploy
63-
chmod +x deploy.sh
64-
./deploy.sh
65-
```
41+
Visit `http://localhost:3001/docs` for API documentation.
6642

6743
## � API Endpoints
6844

deploy.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ docker-compose build --no-cache
1111
docker-compose up -d
1212

1313
echo "✅ GitHitBox deployed successfully!"
14-
echo "🌐 Service running at: http://localhost:8000"
15-
echo "📊 Health check: http://localhost:8000/health"
14+
echo "🌐 Service running at: http://localhost:3001"
15+
echo "📊 Health check: http://localhost:3001/health"
1616
echo "🔍 Logs: docker-compose logs -f githitbox"
1717

1818
docker-compose ps

docker-compose.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@ services:
44
githitbox:
55
build: .
66
ports:
7-
- "8000:8000"
7+
- "3001:3001"
88
environment:
99
- DATABASE_URL=${DATABASE_URL:-sqlite:///./data/profile_counter.db}
1010
volumes:
1111
- ./data:/app/data
1212
- ./.env:/app/.env:ro
1313
restart: unless-stopped
1414
healthcheck:
15-
test: ["CMD", "python", "-c", "import requests; requests.get('http://localhost:8000/health')"]
15+
test: ["CMD", "python", "-c", "import requests; requests.get('http://localhost:3001/health')"]
1616
interval: 30s
1717
timeout: 10s
1818
retries: 3

main.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,4 +283,5 @@ async def health_check():
283283
if __name__ == "__main__":
284284
import uvicorn
285285

286-
uvicorn.run("main:app", host="0.0.0.0", port=8000, reload=True)
286+
port = int(os.getenv("PORT", 3001))
287+
uvicorn.run("main:app", host="0.0.0.0", port=port, reload=True)

render.yaml

Lines changed: 0 additions & 12 deletions
This file was deleted.

run.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ def install_requirements():
1414

1515
def run_server():
1616
print("Starting GitHitBox...")
17-
print("Server will be available at: http://localhost:8000")
18-
print("API Documentation: http://localhost:8000/docs")
17+
print("Server will be available at: http://localhost:3001")
18+
print("API Documentation: http://localhost:3001/docs")
1919
print("\nPress Ctrl+C to stop the server")
2020

2121
subprocess.run(
@@ -27,7 +27,7 @@ def run_server():
2727
"--host",
2828
"0.0.0.0",
2929
"--port",
30-
"8000",
30+
"3001",
3131
"--reload",
3232
]
3333
)

0 commit comments

Comments
 (0)