diff --git a/.env b/.env deleted file mode 100644 index db1f210..0000000 --- a/.env +++ /dev/null @@ -1,4 +0,0 @@ -API_PORT=8000 -POSTGRES_DB=theplug -POSTGRES_USER=theplug -POSTGRES_PASSWORD=theplug_dev_password diff --git a/.env.example b/.env.example index 740eadf..dd920cd 100644 --- a/.env.example +++ b/.env.example @@ -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 + diff --git a/.gitignore b/.gitignore index 485dee6..3bf780b 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ .idea +.env \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index e355b2e..7f7feaa 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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"] diff --git a/README.md b/README.md index 2f15676..9bb915d 100644 --- a/README.md +++ b/README.md @@ -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` diff --git a/docker-compose.yml b/docker-compose.yml index 66f86bc..de14ad2 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -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 diff --git a/pyproject.toml b/pyproject.toml index 9894d6e..e84318c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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", ] diff --git a/src/main.py b/src/main.py index 0542659..b7eb1e7 100644 --- a/src/main.py +++ b/src/main.py @@ -13,3 +13,4 @@ app.include_router(proxy_router) @app.get("/") async def root(): return {"Hello": "World!"} +