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
|
API_PORT=3671
|
||||||
POSTGRES_DB=your_db_name
|
POSTGRES_PASSWORD=pass
|
||||||
POSTGRES_USER=your_db_user
|
|
||||||
POSTGRES_PASSWORD=change_me
|
|
||||||
|
|||||||
@@ -1 +1,2 @@
|
|||||||
.idea
|
.idea
|
||||||
|
.env
|
||||||
+2
-2
@@ -11,6 +11,6 @@ RUN pip install --no-cache-dir --upgrade pip && \
|
|||||||
|
|
||||||
COPY src ./src
|
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
|
FastAPI + PostgreSQL + Redis
|
||||||
```
|
```
|
||||||
|
FastAPI docs: `http://localhost:3671/docs`
|
||||||
## 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`
|
|
||||||
|
|||||||
+2
-2
@@ -6,7 +6,7 @@ services:
|
|||||||
container_name: theplug-api
|
container_name: theplug-api
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
ports:
|
ports:
|
||||||
- "${API_PORT:-8000}:8000"
|
- "${API_PORT:-3671}:3671"
|
||||||
environment:
|
environment:
|
||||||
DATABASE_URL: postgresql://${POSTGRES_USER:-theplug}:${POSTGRES_PASSWORD:-theplug_dev_password}@postgres:5432/${POSTGRES_DB:-theplug}
|
DATABASE_URL: postgresql://${POSTGRES_USER:-theplug}:${POSTGRES_PASSWORD:-theplug_dev_password}@postgres:5432/${POSTGRES_DB:-theplug}
|
||||||
REDIS_URL: redis://redis:6379/0
|
REDIS_URL: redis://redis:6379/0
|
||||||
@@ -16,7 +16,7 @@ services:
|
|||||||
redis:
|
redis:
|
||||||
condition: service_healthy
|
condition: service_healthy
|
||||||
healthcheck:
|
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
|
interval: 10s
|
||||||
timeout: 5s
|
timeout: 5s
|
||||||
retries: 5
|
retries: 5
|
||||||
|
|||||||
+1
-2
@@ -4,6 +4,5 @@ version = "0.1.0"
|
|||||||
description = "Add your description here"
|
description = "Add your description here"
|
||||||
requires-python = ">=3.14"
|
requires-python = ">=3.14"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"fastapi>=0.135.3",
|
"fastapi[standard]>=0.135.3",
|
||||||
"uvicorn>=0.35.0",
|
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -13,3 +13,4 @@ app.include_router(proxy_router)
|
|||||||
@app.get("/")
|
@app.get("/")
|
||||||
async def root():
|
async def root():
|
||||||
return {"Hello": "World!"}
|
return {"Hello": "World!"}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user