chore: update environment configuration and dependencies
This commit is contained in:
@@ -1,4 +0,0 @@
|
||||
API_PORT=8000
|
||||
POSTGRES_DB=theplug
|
||||
POSTGRES_USER=theplug
|
||||
POSTGRES_PASSWORD=theplug_dev_password
|
||||
+3
-4
@@ -1,4 +1,3 @@
|
||||
API_PORT=8000
|
||||
POSTGRES_DB=your_db_name
|
||||
POSTGRES_USER=your_db_user
|
||||
POSTGRES_PASSWORD=change_me
|
||||
API_PORT=3671
|
||||
POSTGRES_PASSWORD=pass
|
||||
|
||||
|
||||
@@ -1 +1,2 @@
|
||||
.idea
|
||||
.env
|
||||
+2
-2
@@ -11,6 +11,6 @@ RUN pip install --no-cache-dir --upgrade pip && \
|
||||
|
||||
COPY src ./src
|
||||
|
||||
EXPOSE 8000
|
||||
EXPOSE 3671
|
||||
|
||||
CMD ["fastapi", "run", "src/main.py", "--host", "0.0.0.0", "--port", "1367"]
|
||||
CMD ["fastapi", "run", "src/main.py", "--host", "0.0.0.0", "--port", "3671"]
|
||||
|
||||
@@ -7,17 +7,4 @@ icona di una presa della spina idk
|
||||
```
|
||||
FastAPI + PostgreSQL + Redis
|
||||
```
|
||||
|
||||
## Docker
|
||||
|
||||
1. Copy env template and customize values.
|
||||
2. Build and start all services.
|
||||
3. Open the API docs.
|
||||
|
||||
```bash
|
||||
cp .env.example .env
|
||||
docker compose up --build -d
|
||||
curl http://localhost:8000/
|
||||
```
|
||||
|
||||
FastAPI docs: `http://localhost:8000/docs`
|
||||
FastAPI docs: `http://localhost:3671/docs`
|
||||
|
||||
+2
-2
@@ -6,7 +6,7 @@ services:
|
||||
container_name: theplug-api
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- "${API_PORT:-8000}:8000"
|
||||
- "${API_PORT:-3671}:3671"
|
||||
environment:
|
||||
DATABASE_URL: postgresql://${POSTGRES_USER:-theplug}:${POSTGRES_PASSWORD:-theplug_dev_password}@postgres:5432/${POSTGRES_DB:-theplug}
|
||||
REDIS_URL: redis://redis:6379/0
|
||||
@@ -16,7 +16,7 @@ services:
|
||||
redis:
|
||||
condition: service_healthy
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "python -c \"import urllib.request; urllib.request.urlopen('http://127.0.0.1:8000/').read()\""]
|
||||
test: ["CMD-SHELL", "python -c \"import urllib.request; urllib.request.urlopen('http://127.0.0.1:3671/').read()\""]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
|
||||
+1
-2
@@ -4,6 +4,5 @@ version = "0.1.0"
|
||||
description = "Add your description here"
|
||||
requires-python = ">=3.14"
|
||||
dependencies = [
|
||||
"fastapi>=0.135.3",
|
||||
"uvicorn>=0.35.0",
|
||||
"fastapi[standard]>=0.135.3",
|
||||
]
|
||||
|
||||
@@ -13,3 +13,4 @@ app.include_router(proxy_router)
|
||||
@app.get("/")
|
||||
async def root():
|
||||
return {"Hello": "World!"}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user