Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ RUN uv sync

EXPOSE 8000

CMD ["uv", "run", "uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000"]
CMD ["uv", "run", "uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"]
15 changes: 14 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,17 @@ services:
POSTGRES_PASSWORD: user
POSTGRES_DB: postgres
volumes:
- postgres_data:/var/lib/postgresql/data
- postgres_data:/var/lib/postgresql/data

backend:
build:
context: .
dockerfile: Dockerfile
container_name: trackntrain_backend
ports:
- '8000:8000'
environment:
ENV: prod
SECRET_KEY: 123456789
ACCESS_TOKEN_EXPIRE_MINUTES: 60
DATABASE_URL: postgresql://user:user@91.169.178.154:5400/postgres
18 changes: 17 additions & 1 deletion src/main.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from fastapi import FastAPI
from fastapi.middleware import Middleware
from fastapi.middleware.cors import CORSMiddleware

from src.entrypoints.api.routers.profile import router as profile_router
from src.entrypoints.api.routers.group import router as group_router
Expand All @@ -13,6 +13,22 @@
version="0.1.0",
)

origins = [
"http://localhost:3000",
"http://127.0.0.1:3000"
"http://localhost:8000",
"http://localhost:5173",
"http://127.0.0.1:8000",
"http://127.0.0.1:5173"
]

app.add_middleware(
CORSMiddleware,
allow_origins=origins,
allow_credentials=True,
allow_methods=["*"],
allow_headers=["*"],
)

app.include_router(profile_router)
app.include_router(group_router)
Expand Down