Updated templates

This commit is contained in:
pptx704
2025-07-21 16:55:56 +03:00
parent 78d578562e
commit 2c845dbdfd
3 changed files with 39 additions and 5 deletions

View File

@ -3,7 +3,7 @@ import enum
import uuid
from typing import List, Optional
from pydantic import BaseModel, EmailStr
from pydantic import BaseModel, ConfigDict, EmailStr
class BaseResponse(BaseModel):
@ -13,5 +13,4 @@ class BaseResponse(BaseModel):
class User(BaseModel):
id: uuid.UUID
class Config:
orm_mode = True
model_config = ConfigDict(from_attributes=True, extra="ignore")

37
docker-compose.prod.yml Normal file
View File

@ -0,0 +1,37 @@
services:
backend:
image: fastapi
build:
context: .
dockerfile: Dockerfile
ports:
- "8000:8000"
environment:
- JWT_SECRET=${JWT_SECRET}
- JWT_ALGORITHM=${JWT_ALGORITHM:-HS256}
- JWT_EXPIRE_MINUTES=${JWT_EXPIRE_MINUTES:-60}
- SQLALCHEMY_DATABASE_URL=postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@db:5432/${POSTGRES_DB}
- WAIT_HOSTS=db:5432
depends_on:
db:
condition: service_healthy
restart: unless-stopped
env_file:
- .env
db:
image: postgres:15.3
environment:
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
- POSTGRES_DB=${POSTGRES_DB}
volumes:
- ./docker-data/postgres:/var/lib/postgresql/data
restart: unless-stopped
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}"]
interval: 5s
timeout: 5s
retries: 5
env_file:
- .env

View File

@ -27,8 +27,6 @@ services:
- POSTGRES_DB=${POSTGRES_DB}
ports:
- "5432:5432"
volumes:
- ./docker-data/postgres:/var/lib/postgresql/data
restart: unless-stopped
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}"]